56 Networking and Online Games: Understanding and Engineering
56 Networking and Online Games: Understanding and Engineering Multiplayer Internet Games Destination 136.80.1.5 Source w.x.y.z TCP or UDP payload Destination MAC.2 Source MAC.1 IP packet IP packet Ethernet frame EtherType 0×800 Figure 4.13 IP packets from the router at 136.80.1.2 to the host at 136.80.1.5 are encapsulated for transmission between Ethernet addresses MAC.1 and MAC.2 For example, if Interface 1 belonged to a router whose forwarding rules had just decided send this packet to the interface identified as 136.80.1.5 , the following two steps would be executed A mapping would be established from 136.80.1.5 to MAC.2, the link layer address of Interface 2. The IP packet would be sent from MAC.1 to MAC.2 inside a suitably constructed Ethernet frame. Figure 4.13 shows a highly simplified picture of how an IP packet from outside the 136.186.1/24 subnet would be encapsulated inside an Ethernet frame to be sent from Interface 1 to Interface 2. Ethernet frames carry an ethernet protocol type code EtherType of 0×800 to identify the payload as an IP packet (or more precisely, an IPv4 packet). 4.2.3.2 Address Resolution Next-hop IP addresses are mapped to link layer addresses in a process referred to as address resolution. Address resolution may occur using information that is manually configured or is dynamically discover on-demand. Manual configuration is unwieldy in all but the simplest of static network configurations. Most routers and hosts implement a dynamic Address Resolution Protocol (ARP) to identify what link layer address is associated with a particular IP address. ARP allows IP interfaces to move from one link layer interface to another without manually reconfiguring all the other interfaces attached to the link. This can be useful when, for example, an Ethernet card is replaced on a host or router the Ethernet address changes, and the dynamic ARP process will ensure other interfaces on the link soon learn the new mapping. Figure 4.14 attempts to capture how ARP is both a peer of, and a service for, the IP layer. Interfaces keep current address mappings in a local cache, an ARP table,which is searched each time a packet is transmitted. If a mapping exists, it is used. Otherwise the ARP is executed to discover the desired mapping. To ensure that old or incorrect mappings are regularly refreshed, cached ARP table entries are deleted after a period of time. Each link layer technology has its own ARP mechanism. Some examples are ARP for IP over FDDI [RFC1390] and IP over ATM [RFC2225]. Perhaps the longest serving example
Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost Clan Web Hosting services