18 Building the Mobile Internet Bit o 3 7 1115192327 31 Version IHL Type of Service Total Length Flags Fragment Offset 63 Time to Live Protocol Header Checksum 95 IPv4 Source Address 127 IPv4 Destination Address 159 Options Padding 19 Payload(Variable Length) Figure 2-6 IPv4 Packet Format IPv6 Addresses Mainly because of the foreseen shortage of IPv4 address space,the Internet Engineering Task Force (IETF)has defined a new version of the Internet Protocol,Internet Protocol version 6(IPv6).documented in RFC 2460).IPv6 has a much larger address space by using 128-bit instead of 32-bit addresses.In addition to this,IPv6 contains other features to automatically assign addresses to hosts and to make routing more efficient.Figure 2-7 shows the IPv6 packet format. From <www.wowebook.com>
ptg Figure 2-6 IPv4 Packet Format IPv6 Addresses Mainly because of the foreseen shortage of IPv4 address space, the Internet Engineering Task Force (IETF) has defined a new version of the Internet Protocol, Internet Protocol version 6 (IPv6), documented in RFC 24603 . IPv6 has a much larger address space by using 128-bit instead of 32-bit addresses. In addition to this, IPv6 contains other features to automatically assign addresses to hosts and to make routing more efficient. Figure 2-7 shows the IPv6 packet format. 18 Building the Mobile Internet IPv4 Source Address Version Type of Service Total Length Identification Flags Fragment Offset IHL Time to Live Protocol Header Checksum IPv4 Destination Address Options Padding Payload (Variable Length) 63 127 191 31 95 159 Bit 0 3 7 11 15 19 23 27 31 0 From <www.wowebook.com>
Chapter 2:Internet"Sessions"19 Bit o 3 7 11 1519 23 27 31 0 Version Traffic Class Flow Label Payload Length Next Header Hop Limit 6< IPv6 Source Address 127 191 IPv6 Destination Address 255 319 Payload(Variable Length) Figure 2-7 IPv6 Packet Formar Routing As you saw before,all communication between endpoints on the Internet is divided into sender to a receive outing is the process of discovering how to forward the packets from sender to receiver Routers ets from one network to the other.So,for the router to know what to do with a particular IP packet,it needs to have knowledge about networks that can be reached through a par- ticular interface. From<www.wowebook.com>
ptg Figure 2-7 IPv6 Packet Format Routing As you saw before, all communication between endpoints on the Internet is divided into IP packets sent from a sender to a receiver. Routing is the process of discovering how to forward the packets from sender to receiver. Routers Routers are intermediate devices in the network that have multiple network interfaces that are connected to more than one network at the same time and that can forward packets from one network to the other. So, for the router to know what to do with a particular IP packet, it needs to have knowledge about networks that can be reached through a particular interface. Chapter 2: Internet “Sessions” 19 IPv6 Source Address IPv6 Destination Address Version Traffic Class Flow Label Payload Length Next Header Hop Limit Payload (Variable Length) 63 127 191 255 319 31 Bit 0 3 7 11 15 19 23 27 31 0 From <www.wowebook.com>
20 Building the Mobile Internet Routina Protocols of course,impossible to know about all the hosts on the Internet and their location,not to mention the fact that this changes every second.This is where routing protocols come in.Through the use of routing protocols,routers learn which networks are reachable through which interface.That is,routers tell other routers to which they have a direct connection,which networks are reachable through them.Routers have an internal table that they use to look up over which interface they should send a packet for a particular IP address.because of me ory limitations.smaller routers usually have only a relatively mber of entries in their routing table for dire tly attached hosts and forw d all ts to a router that has more routing information.This path is the so-called Routing protocols fall into two broad categories: Interior gateway protocols (IGP):IGPs are the protocols used inside an administra tive domain.Examples of widely used IGPs are Open Shortest Path First(OSPF). Routing Information Protocol(RIP),and Intermediate System-to-Intermediate System(IS-IS).These protocols focus on routing IP packets as efficiently as possible. Exterior gateway protocols(EGP):EGPs are the protocols that are used betweer administrative dor ains.Here effi ency is not the only criterion.One particular host gh diffe s business relati tation,and pas experience This process is therefore a policy-basedouting The E GP is Border Gateway Protocol(BGP)(currently version 4,documented in RFC 4271). The routes that IP packets take often have a large impact on the time needed to send a packet from source to destination.Therefore,a lot of research goes into ensuring that routers learn as soon as possible where to send an IP packet.Inefficient routing leads to detrimental performance of applications. Broadcast Sometimes all devices on a particular network need to be reached.for example.to find out which device can route packets elsewhere or to find out which device has a particular IP address.This mode of o packet is usedv here all the bits of the host-id a packet t this ress(a broadcast message)is the same as sending it to all hosts in the same net- work as the host IP Multicast Often,many thousands of hosts spread over the Internet want to receive the same appli cation data.Think,for example,of a live TV broadcast on the Internet.The way the Internet works,this would result in many thousands of IP packets containing the exact From <www.wowebook.com>
ptg Routing Protocols For hosts that are directly connected to the same network as the router, it is easy to configure the router to send IP packets out over the right interface. The problem is that it is, of course, impossible to know about all the hosts on the Internet and their location, not to mention the fact that this changes every second. This is where routing protocols come in. Through the use of routing protocols, routers learn which networks are reachable through which interface. That is, routers tell other routers to which they have a direct connection, which networks are reachable through them. Routers have an internal table that they use to look up over which interface they should send a packet for a particular IP address. Because of memory limitations, smaller routers usually have only a relatively small number of entries in their routing table for directly attached hosts and forward all other packets to a router that has more routing information. This path is the so-called default route. Routing protocols fall into two broad categories: ■ Interior gateway protocols (IGP): IGPs are the protocols used inside an administrative domain. Examples of widely used IGPs are Open Shortest Path First (OSPF), Routing Information Protocol (RIP), and Intermediate System–to–Intermediate System (IS-IS). These protocols focus on routing IP packets as efficiently as possible. ■ Exterior gateway protocols (EGP): EGPs are the protocols that are used between administrative domains. Here efficiency is not the only criterion. One particular host is usually reachable through different routes; business relations, reputation, and past experience determine which route is preferred, or even possible. This process is therefore also called policy-based routing. The dominant EGP is Border Gateway Protocol (BGP) (currently version 4, documented in RFC 42714 ). The routes that IP packets take often have a large impact on the time needed to send a packet from source to destination. Therefore, a lot of research goes into ensuring that routers learn as soon as possible where to send an IP packet. Inefficient routing leads to detrimental performance of applications. Broadcast Sometimes all devices on a particular network need to be reached, for example, to find out which device can route packets elsewhere or to find out which device has a particular IP address. This mode of operations is called broadcast. For this purpose, a particular type of IP packet is used where all the bits of the host-id are set to 1. Sending a packet to this IP address (a broadcast message) is the same as sending it to all hosts in the same network as the host. IP Multicast Often, many thousands of hosts spread over the Internet want to receive the same application data. Think, for example, of a live TV broadcast on the Internet. The way the Internet works, this would result in many thousands of IP packets containing the exact 20 Building the Mobile Internet From <www.wowebook.com>
Chapter 2:Internet"Sessions"21 same data,with the only difference being the destination IP address.Special protocols have been developed for this type of application called IP mulricast.Multicast routing protocols ensure that the same payload is sent only once over a given connection.For this application,a special set of IP addresses have been reserved (224.0.0.0 through 239.255.255.255)that are not assigned to hosts for normal ip communications.but are reserved just for multicast purposes.The multicast layer can be seen as another abstrac tion layer on top of the physical network,and just like for regular IP where the routing layer needs to keep track of which IP addresses are associated with which physical addre ses,the multicast routing layer needs to keep track of which multicast addresses are assc ciated with which group of hardware addresses Network Address Translation ified host could uniqu mal IP addr s.T is is not completely true:in real n use an inte ressing sch that is not exposed to th ne rest c the Internet (called private addresses).The reasons for this setup vary from the desire to use as few globally unique IP addresses as possible and the (perceived)security benefits of not exposing the internal network setup,to an easier network setup by using much larger address ranges than could be obtained from local Internet registries.If a host that has only a locally unique address wants to communicate with a host on the global Internet,it has to communicate through another host that does have a globally unique address and that maps the local address to a global address.This process is called Network Address Translation (NAT).NAT b aks the rmal c nication betweer however,over the years,many protocols hav adapted to be AT If the IP addresses used internally are also being used externally.problems will arise. because they are not guaranteed to be unique from the point of view of the destination. Therefore,some special ranges of IP addresses have been reserved for use as private addresses.The private address ranges are 10.0.0.0/8,172.16.0.0/12,and 192.168.0.0/16 and cannot be used on the public Internet. If ipv6 gains wide adoption.nat will no longer be required for overcoming address ges How er nat solutions are beir ced for coe ence of IPv4 and IPv6 tov6.In that case.NAT isused totranslate s on network into IPv6 addresses on another netwo nd vice versa TCP/IP Five-Layer Model You are now familiar with the importar ce of the IP layer sitting as an abstraction layer tween the application and the netw layers. What has not been c scussed yet is exactly how the IP packets are turned into something that the network can understand,or how applications that run on the Internet can transform their application-specific data into IP packets.As it turns out,it makes sense to further divide both the network part and the application part to separate generic functionality from specifics.The result of From<www.wowebook.com>
ptg same data, with the only difference being the destination IP address. Special protocols have been developed for this type of application called IP multicast. Multicast routing protocols ensure that the same payload is sent only once over a given connection. For this application, a special set of IP addresses have been reserved (224.0.0.0 through 239.255.255.255) that are not assigned to hosts for normal IP communications, but are reserved just for multicast purposes. The multicast layer can be seen as another abstraction layer on top of the physical network, and just like for regular IP where the routing layer needs to keep track of which IP addresses are associated with which physical addresses, the multicast routing layer needs to keep track of which multicast addresses are associated with which group of hardware addresses. Network Address Translation In the explanation about hosts on the Internet, you learned that every host could uniquely be identified and had a globally unique IP address. This is not completely true; in reality, networks often use an internal IP addressing scheme that is not exposed to the rest of the Internet (called private addresses). The reasons for this setup vary from the desire to use as few globally unique IP addresses as possible and the (perceived) security benefits of not exposing the internal network setup, to an easier network setup by using much larger address ranges than could be obtained from local Internet registries. If a host that has only a locally unique address wants to communicate with a host on the global Internet, it has to communicate through another host that does have a globally unique address and that maps the local address to a global address. This process is called Network Address Translation (NAT). NAT breaks the normal communication between hosts on the Internet; however, over the years, many protocols have been adapted to be able to deal with NAT. If the IP addresses used internally are also being used externally, problems will arise, because they are not guaranteed to be unique from the point of view of the destination. Therefore, some special ranges of IP addresses have been reserved for use as private addresses. The private address ranges are 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16 and cannot be used on the public Internet. If IPv6 gains wide adoption, NAT will no longer be required for overcoming address shortages. However, NAT solutions are being proposed for coexistence of IPv4 and IPv6 during the transition to IPv6. In that case, NAT is used to translate IPv4 addresses on one network into IPv6 addresses on another network and vice versa. TCP/IP Five-Layer Model You are now familiar with the importance of the IP layer sitting as an abstraction layer between the application and the network layers. What has not been discussed yet is exactly how the IP packets are turned into something that the network can understand, or how applications that run on the Internet can transform their application-specific data into IP packets. As it turns out, it makes sense to further divide both the network part and the application part to separate generic functionality from specifics. The result of Chapter 2: Internet “Sessions” 21 From <www.wowebook.com>
22 Building the Mobile Internet that is a layered model,in which the various layers each have their own functionality.For example,this allows different applications to share a generic communications layer and a protocol developer to concentrate on one layer without having to implement the com- plete protocol stack. In the course of internetworking history,a number of layering approaches have been pro- posed,all trying to strike a balance between functional decomp sition and increased ving to define the interactions between the layers in a network model.A del tha t will be as a rete his book.i five-layer m TCP/IP five-layer model Layer Application Layer Application Laver Layer 4 Transport Layer Transport Layer Internet or IP Layer Internet or IPLayer Layer 2 Data Link Laver Data Link Laver Layer Physical Layer Figure 2-8 TCP/IP Five-Layer Model The data of one layer is carried as payload in the packets on the layer below it.This sponding layer at the other host. "Largely opaque"refers to the fact that it often makes sense from an operational point of view to "leak information from one layer to the other- or example,to optimize an application for transport over a particular type of network. Lower layers typically refer to those layers that are below the Internet layer(also called the IP layer),and conversely,bigber layers are those that are above the Internet layer. From <www.wowebook.com>
ptg that is a layered model, in which the various layers each have their own functionality. For example, this allows different applications to share a generic communications layer and a protocol developer to concentrate on one layer without having to implement the complete protocol stack. In the course of internetworking history, a number of layering approaches have been proposed, all trying to strike a balance between functional decomposition and increased complexity in having to define the interactions between the layers in a network model. A widely accepted model, and the model that will be used as a reference in this book, is the TCP/IP five-layer model, which has been described by Comer5 . Figure 2-8 illustrates the TCP/IP five-layer model. 22 Building the Mobile Internet Application Layer Transport Layer Internet or IP Layer Data Link Layer Physical Layer Application Layer Transport Layer Internet or IP Layer Data Link Layer Layer 1 Layer 2 Layer 3 Layer 4 Layer 5 Figure 2-8 TCP/IP Five-Layer Model The data of one layer is carried as payload in the packets on the layer below it. This process is called encapsulation, as illustrated in Figure 2-9. Data of the higher layers is largely opaque to the layers below it. A particular layer at one host “talks” to the corresponding layer at the other host. “Largely opaque” refers to the fact that it often makes sense from an operational point of view to “leak” information from one layer to the other—for example, to optimize an application for transport over a particular type of network. Lower layers typically refer to those layers that are below the Internet layer (also called the IP layer), and conversely, higher layers are those that are above the Internet layer. From <www.wowebook.com>