Readit News logoReadit News
tzs · 3 years ago
There is a long history of identifiers being reused in world shipping.

One of the staples of contracts class in the first year at many law schools is Raffles v Wichelhaus, an English contract case from 1864.

There was a contract for someone to sell a bunch of bales of cotton from India to a buyer in England. The contract called for the cotton to be sent on a ship called the Peerless to Liverpool from Bombay.

Unknown to both the buyer and the seller there were actually two different ships called Peerless both sailing from Bombay to Liverpool, one arriving in October and one in December.

They seller was thinking of the December one when signing the contract, and the buyer was thinking of the October one.

The buyer needed the cotton in October and when it did not arrive on the Peerless in October the buyer considered the contract broken and refused to accept the cotton that came on the December Peerless.

magicalhippo · 3 years ago
We encounter this all the time at work. New customer, so new integration. What's your unique shipment reference? This one? Ok fine. Go into production, and after a few months we get missing shipments. Support check, missing shipments have same reference as old shipments. "Oh, yeah we reuse the references after about 90 days... And, no, we don't have any globally unique references."

This is fun when so much of the flow is based on these references, think goods arrival scanning, and sometimes shipping does take a long time so 90 days or whatever is cutting it close.

auggierose · 3 years ago
Why would you ever reuse an identifier like that? Is there some kind of material cost associated with a new identifier?
vba616 · 3 years ago
>"Oh, yeah we reuse the references after about 90 days... And, no, we don't have any globally unique references."

The minute a simple unique identifier is established for something, someone who is just important enough not to be told "no" screws it up.

A thing that I've seen is that people want things to be grouped together in reporting, so they insist on it having the same identifier as all other things in the same group.

Sooner or later, they ask for a report that distinguishes between them, though.

taneq · 3 years ago
Add shipping container IDs and ship IDs to the list of annoying human-oriented numbers that you can't assume are unique. :P
yashg · 3 years ago
So Peerless wasn't really peerless afterall.
jameshart · 3 years ago
There's the beginnings of an Abbott and Costello skit here.

"I went to the pier to meet the Peerless but the cotton didn't appear"

"Did you talk to Captain Pierre?"

"Captain Pierre of the Peerless? No, the captain of the Peerless was Captain Pearce"

"Well did you talk to Captain Pearce?"

"Yes, on the pier." ...

mikro2nd · 3 years ago
Naah... it was a peerless-to-peerless network.
petesergeant · 3 years ago
> Consequently, as there was no consensus ad idem ("meeting of the minds"), the two parties did not agree to the same thing and there was no binding contract ... therefore, the [buyer] did not have to pay.
sigstoat · 3 years ago
well you can’t stop halfway through the story. what was the outcome of the case?
manytree · 3 years ago
Defendents didn’t pay for the cotton

https://en.m.wikipedia.org/wiki/Raffles_v_Wichelhaus

Dead Comment

asah · 3 years ago
(IANAL)

Reading this case, I'm surprised at the outcome. The seller fulfilled on the terms of the contract.

The contract also didn't specify the precise color or weight of the cotton, the exact destination, etc etc etc so the defendant could make similar claims to renege on the contract.

Granted, time is arguably special inasmuch as it allows the seller to construct a scenario for fulfillment, e.g. the seller could've delivered 100 years later on a new boat that happened to be named Peerless. That's clearly not the intent.

In that sense, a contract can be considered void if it doesn't reasonably specify time.

thaumasiotes · 3 years ago
> In that sense, a contract can be considered void if it doesn't reasonably specify time.

The judgment states pretty clearly that a contract is void if the two parties, at the time they made the contract, did not agree on what it meant.

> the moment it appears that two ships called the “Peerless” were about to sail from Bombay there is a latent ambiguity, and parol evidence may be given for the purpose of shewing that the defendant meant one “Peerless,” and the plaintiff another. That being so, there was no consensus ad idem, and therefore no binding contract.

[The words are from the defendant's lawyer, but the court appears to have agreed immediately.]

So this isn't formally a "win" for the defendant - formally, there never was a contract, and the suit was dismissed for failure to state a claim.

sporkland · 3 years ago
I felt bad for the seller for a while. Then I realized they probably just sold the cotton to someone else, and that fungibility and liquid markets make a lot of this stuff less risky on both sides.
rossmohax · 3 years ago
If shipping was done under now void contract, will transport company be paid at all?
tshaddox · 3 years ago
You’d think serious contracts would normally have provisions that would require mentioning expected dates, since late shipments would presumably be a common occurrence you’d want all parties to consider explicitly.
wahern · 3 years ago
According to A.W. Brian Simpson, "Contracts for Cotton to Arrive: The Case of the Two Ships Peerless", Contracts Stories, p43,

> A contract for cotton "to arrive" was a contract for forward delivery, or, as it is sometimes called, a "time contract". One might expect that such a contract would normally specify a time for delivery. For it is the moment when the goods become available in the market that is of paramount importance to the purchaser, particularly if the purchaser wants the goods for use. But the world in which such contracts originated was one in which this was not really possible. Although one could discover, after an interval, when a sailing ship had left or, more approximately, proposed to leave its port of departure, it was very uncertain when, if ever, it would arrive at its destination. Even when it did arrive, there were uncertain delays in finding a berth to unload its cargo. Hence such contracts did not originally specify the time of arrival, much less delivery, even within some fixed period. All they did was to identify which shipment of cotton was being sold; presumably the rationale of this was that the buyer, so long as he knew which shipment was being sold, would be able to form his own estimate of the probable time of arrival. This would not, of course, be a point in time but a period. It is said that originally such contracts were made only when arrival was imminent, the ship typically having been reported off Point Lynas, which is on the north coast of Anglesey, some fifty miles from Liverpool. Presumably there was a signal station there. No doubt also cotton was sometimes sold as the ship lay in the river, waiting to berth. In such cases the date of delivery could be guessed with some precision, though a square-rigged vessel, if it did not employ a steam tug, could take a long and unpredictable time to cover even fifty miles.

The author also provides the broader context, which is that this was likely a form contract in the nascent commodity futures market. Additionally, this occurred during a period of particularly overheated speculation in cotton. In other words, just as is common today, financial speculators were pushing the legal and technological envelope of the instruments available to them. (Futures markets go back much further, but the mid-19th century is in many respects when modern futures markets began to take on their current shape. He cites another source pointing out that in "'in certain offices in Liverpool today the futures department is still called the Arrivals Department.'")

raincom · 3 years ago
Lessons from such cases(or case law) make one specify expected dates.
arecurrence · 3 years ago
The manufacturer reused identifiers (5 to be precise) in a later batch. This was a manufacturing error rather than a freak collision.

Edit: Source https://www.thedailystar.net/business/news/two-containers-sa...

"Five containers of the second batch have numbers akin to another five belonging to the previous batch, according to Borhan."

Pxtl · 3 years ago
Whenever I see somebody detailing the scope of a mistake at their business, I mentality add the words "at least" to any quantities.
bee_rider · 3 years ago
I add it to the person instead.

"Five containers of the second batch have numbers akin to another five belonging to the previous batch, according to Borhan, at least."

This is much more reassuring because it just looks like Borhan needs to get his shit together. Optimism!

bluehorseray · 3 years ago
Glad to finally see https://container-news.com/ hit the front page on HN
SturgeonsLaw · 3 years ago
This is legit one of the things I love most about HN, articles might be 80% about tech, but the content in the remaining 20% can be about pretty much anything, and it's always fascinating to get insight into other domains. Never considered that containers were numbered, let alone that a number clash is a significant incident, but thinking about it, yeah it makes sense.
hadlock · 3 years ago
This is kind of what big chunks of the internet were like back in the late 90s, very early 2000s, particularly before smart phones.
Barrin92 · 3 years ago
Maybe a rare opportunity to plug one of my favorite non-fiction books, The Box, about how shipping containers restructured global trade.

https://press.princeton.edu/books/paperback/9780691170817/th...

jacquesm · 3 years ago
And much more than trade. It had effect on road infrastructure, various temporary constructs including school rooms for emergency situations and housing as well.
ashildr · 3 years ago
Thank you for mentioning this book!
smarx007 · 3 years ago
Wrong containers!
yetanother-1 · 3 years ago
Still good lesson learned.
shreyshnaccount · 3 years ago
surprised but really not to see people so passionate and dedicated to containers. warms my heart, really best thing to ever happen.

Dead Comment

ortusdux · 3 years ago
It sounds like the actual unique number is only 6 digits long and chosen by the manufacturer, so it could either be a mistake or identical randomly generated numbers. My math is a bit rusty - how you you solve the birthday problem for 1mil instead of 365?

https://containertech.com/articles/shipping-container-number...

https://en.wikipedia.org/wiki/Birthday_problem

jfim · 3 years ago
1178. This is actually part of the base stats package in R:

  > qbirthday(prob = 0.5, classes = 1000000, coincident = 2)
  1178
See https://www.rdocumentation.org/packages/stats/versions/3.6.2...

kgermino · 3 years ago
It’s worth noting the full number isn’t just the six digits (plus checksum) but the full number including the letters that indicate owner and type, so a single owner wouldn’t give two of their containers the same number.

That said, how many containers is one company likely to own? 1,000,000 is a big number but it seems like some of the big logistics companies could flirt with that. Doors anyone know if they have multiple “owner codes” or an I just way overriding the scale here?

throw0101a · 3 years ago
> Doors anyone know if they have multiple “owner codes” or an I just way overriding the scale here?

Like IEEE OUIs, one company can have multiple owner prefixes. Maersk has 41:

* https://www.bic-code.org/bic-company-search/?searchterm=MAER...

* https://en.wikipedia.org/wiki/ISO_6346

runnerup · 3 years ago
Maersk has a capacity to ship 4 million containers at once. I suspect you’d generally have 3-4x that many because they spend a lot of time waiting around and also just pile up in Los Angeles because no one needs to ship (as much) stuff back to China.
mlyle · 3 years ago
Cheap approximation is square root.
woodruffw · 3 years ago
Yep, and it's pretty close in this case: for a 50% chance, a sample of 1178 containers with 6-digit numbers (assuming a uniform distribution) would suffice.
gruez · 3 years ago
Using the formula on wikipedia and checking random numbers it looks like the number required for 50% chance of collision is around 1200.

https://www.wolframalpha.com/input?i=1-%28999999%2F1000000%2...

https://en.wikipedia.org/wiki/Birthday_problem#A_simple_expo...

vecter · 3 years ago
I think you meant to link to 1-(999999/1e6)^(1178 choose 2) [0]

[0] https://www.wolframalpha.com/input?i=1-%28999999%2F1000000%2...

jhugo · 3 years ago
It's a mistake. They keep track of numbers they've already used, but in this case failed to do so properly.

Deleted Comment

emmelaich · 3 years ago
Here's the derivation of a formula by Matt Might

https://matt.might.net/articles/counting-hash-collisions/

amenghra · 3 years ago
You can approximate the birthday paradox by taking the square root. So 1mil gives you ~1000. 365 is ~19 (the actual value is 23).
lamontcg · 3 years ago
When I worked at Amazon we found two NICs with the same MAC address.

And that was a long time ago with a comparatively very small server count compared to today.

Someone's manufacturing database probably had a tiny race condition.

hericium · 3 years ago
Worked for a small ISP in early 2000s. Not every new customer had an ethernet card in their PC and we had problems like installation crews calling the office that there is no port to stick the cable in.

The company obtained 300 cheap Intel PRO/100 Fast Ethernet NICs from China. The idea was that the crews would have a bunch of those cards to be able to install them in customers' computers.

Everything was dandy until second installation in the same building. For a little more backstory - it was a kind of shitshow infra with dumb switches and all customers in a building being in the same LAN.

So... the second installation in the same building rendered the former newest customer's link inoperable. Or wouldn't work, then suddenly there was connectivity, then there was no ping to the gateway but some other devices were pingable etc etc. The crew replaced the card with another one (from the same shipping), re-crimped RJ45s on both ends, changed switch port and nothing - same shit with random internet connectivity losses. Weird situation with seemingly no reason for what was happening.

It later turned out that the reason was that all 300 NICs had the same MAC address. All of them.

cricalix · 3 years ago
20-odd years ago, the college I attended (and worked for) was outfitting one of the computer labs with new network cards; migrating from Token Ring to Ethernet as I recall. To do this, 3COM cards had been bought by the boxful.

We replaced all of the cards, and booted the lab. 1 machine got an IP and then it all went to hell. Every single machine showed up with the same MAC. Think we had to rip and replace to fix it.

halestock · 3 years ago
I used to work for a company that sold labels for various third party printer manufacturers, and let me tell you, some of them were VERY lazy when it came to assigning MAC addresses.
ghostly_s · 3 years ago
yep, not unheard of for cheap unbranded devices to all have the same MAC, unfortunately.
HeyLaughingBoy · 3 years ago
I worked for a company that made a networking product and we managed to build 1,000 units with the same MAC address (we had a big block of assigned addresses) because of a miscommunication with the vendor who provided the preprogrammed microcontrollers..

Luckily the MAC was in a rewritable location so it was possible, if a royal pain in the ass, to reprogram them all.

cardiffspaceman · 3 years ago
I'm having trouble finding a reference just now, but the MAC address for a modem-based link on Windows had "DESK" until it started causing real trouble. And one of those problems was that GUIDs were obtained by using "the MAC address" of the PC as an input to a DEC-Intel-Xerox-Microsoft algorithm. Around the time of this coming to a head, it came up that some manufacturers were out of MAC addresses for whatever reason, and also that some manufacturers were assuming that two random NICs on an Ethernet would not both be one of $MANUFACTURER's cards, so care was not necessary.
banana_giraffe · 3 years ago
The container in question is SLHU4500470. The first four characters are the owner, the next 6 digits are the unique (per owner) number, and the last digit is a check digit.

Somehow I always assumed there'd be more than 6 digit IDs for these things. I'd guess collisions have happened, but never been caught in the same port before.

watchdogtimer · 3 years ago
I believe the 4th character of a container ID is always a U, so the container owner is the first 3 characters.
robk · 3 years ago
U is code for freight container so yes :)
Denvercoder9 · 3 years ago
What happens when somebody has more than a million containers? 6 digits doesn't seem enough to guarantee uniqueness.
throw0101a · 3 years ago
Like IEEE OUIs, one company can have multiple owner prefixes. Maersk has 41:

* https://www.bic-code.org/bic-company-search/?searchterm=MAER...

* https://en.wikipedia.org/wiki/ISO_6346

addaon · 3 years ago
There's only about six million active containers in the world. If one owner has more than a sixth of them, an easy fix would be to issue them a second owner code, basically extending the six-digit field by a bit.
cortesoft · 3 years ago
You assign a second owner number to the group, probably
CodeWriter23 · 3 years ago
Ahem, 10 million
webmobdev · 3 years ago
> “I have never seen two containers carrying the same number in my 27 years of career in the shipping sector,” pointed out Mohammed Abdullah Jahir, chief operating officer of Saif Maritime Ltd, adding that such an incident cannot be detected unless the boxes arrive at the same port at the same time.

If the port authority conducting the inspection are not diligent, it's easy to miss this.

hakfoo · 3 years ago
I always wondered if this was designed to integrate into the existing railway numbering system. In the US, at least, owner identifiers are pretty consistently 4 characters or less, and individual unit numbers are 6 digits or less (i. e. BNSF 123456).
namecheapTA · 3 years ago
I worked at a small "automall" of several dealerships. Our system operated inventory numbers based on the last 6 digits of the vin#. Sounds like with 1 million options, you'd be fine. It didn't take long for duplicates to start coming up when you have hundreds of cars in stock, and sell hundreds a month. Let alone the problem with a car being sold new, and then being traded back in. That was fine, because we had a different leading digit for new vs used. But you'd be surprised how often a used car gets sold, and then traded in again at the same place. Now what number does it get? The same one. Fine, atleast they're not both in stock at the same time. Great. Sell it again. Then when a customer calls six months later, try and lookup the deal your most common way... Oh ya.. now I've got 4 possible deals for this car.
swamp_thing · 3 years ago
Haha. It’s like Hacker news AI that votes things up saw container and port and decided it’s a great devops story from Bangladesh.