It's my understanding that by "metric" or "metrics" we describe the length ( in bytes right ? ) of a package traveling over the network, the problem is that as far as I know this value it's ISP related and it's almost impossible to find even 2 ISP with the same metric.
If I'm programming a P2P software to keep 2 software synced, and I would like to estimate what is the optimal size for my packets, does it makes sense to keep metrics in the count especially due to the fact that is an ISP related value and in the entire world there are a lot of ISPs ? I should apply some "heuristic algorithm" like assuming that the best metric is the lowest one and I just keep adding empty values for the padding on the longest one ?
Thanks.
PS if you need a starting point for an example I would prefer something in C++ since i'm interested in this language at the moment.
EDIT: a recap of the comments that you can find down below: looks like my question is too generic and now I'm focusing on MTU and latency ( lag ) to keep things more straight to the point.
Networking (and in particular inter-networking) is a relatively young science, not yet completely formed. Hence not all the "right behavior" is "shared" by anyone, simply because there are not all believing (or forced) to rein it "right". The consequence is that anyone must -at some level- "care" of anything since it is never possible to have a full trust.
That said, to come close to your problem, let me start by telling you that you are yourself "unstrusted" since you use improper terminology.
You speak about networking "metric" (something, that, in networking science is related to routing) but you talk about something else, that is the MTU (Maximum Transfer Unit). If you speak to a network engineer that way, you almost sure you'll never find the answer to your question, simply because he will most likely understand another completely unrelated thing.
Now that everything is clear (I hope), lets understand a little bit of theory:
And this is why you have to take care: network performance are not the same for whatever packet length: longer packets into TCP requires less "waiting for acknowledge" time (so data transfer can flow faster), but longer packets requires longer latency in case of intermediate fragmentation, and more processing power on routers. (at the point that many ISP don't fragment: if it cannot go, they just discard, and let TCP to re-tune to a smaller MTU, or to the application to shorten its UDP packets).
In other word, if you don't care about performance, Just let TCP do do its job, and the data will somehow find a way to flow (by an intermediate fragmentation or by a and-to-end MTU negotiation). But if you want to maximize the performance, the less error-control-and recovery mechanisms you "stimulate" the less latency you get, and hence the more wide "segments" you get and hence the higher data rate you get.
There is an "optimal length" for every path you can have between the two endpoints you have to discover and respect if you want better performance.
If you use UDP, things are a bit worst: since there is no MTU negotiation and recovery, if a too long packet gets discarded along the way (because at a certain point it will no more fit a physical media, and the ISP is not going to fragment, to protect himself and other clients) you have to take care, and reduce its size, otherwise you will never be able to transfer it.
Feel free to retain the ISP is "unfair" to you, but consider that an excess of fragmentation activity can sit a router at the point no other transmission is possible from nowhere to no-one. And this is a damage higher than simply drop you flow.