Determine Request Delay

I am working on a version of Pastry originally in Go. From the design [PDF]:

It is assumed that the application provides a function that allows each node confectioner to determine the "distance" from node with a given IP address for itself. A node with a lower distance value is considered more desirable. It is expected that the application will perform this function depending on its choice of proximity metrics, using network services such as traceroute or the Internet subnet of the map and appropriate caching and approximation methods to minimize overhead.

I am trying to figure out what is the best way to determine the “proximity” (ie network latency) between two instances of EC2 programmatically from Go. Unfortunately, I do not know enough about low-level networks to be able to distinguish between the different types of queries that I could use. Googling made no suggestions for measuring latency from Go, and general latency methods always seem like Linux files, which I hope to avoid in the name of fewer dependencies. Any help?

In addition, I note that the latency should be on a scale of 1 ms between two instances of EC2. Although I plan to use the implementation on EC2, it can hypothetically be used anywhere. Is latency overall so bad that I have to spend effort on ensuring the proximity of a network of two nodes? Keep in mind that most requests for confectionery can be served in a database of 16 of the servers in the cluster (therefore, for an average of 10,000 servers, approximately 3 requests are required to find a key search). Is latency from, for example, Asia Pacific EC2 to the EU-East EC2 region sufficient to justify the increased complexity and overhead caused by delay checks when adding nodes?

+3
source
1

(node -hops ) . , . (EC2 "local" ).

go, , net - , . , (ICMP ping) IP-

conn, err := net.Dial("ip4", "127.0.0.1")

ICMP- . (. ICMP, IPv6 .) , ICMP-, , TCP UDP, , .

conn conn Writer, , ICMP, .

ICMP Type . 8, 1 30 - , . 8 , 1. , , 30 .

, IP-. , IP-, net, , .

Dial(), internetSocket, /. , Im - , , , IP- . , DialIP internetSocket /​​. , cgo ( ).

IPv6, ICMPv6. v4.


, Id (timed ping) (r) , node - , . , , 2 ( , ..).

+5

All Articles