Unit Iii: 3.1 Circuit Switching vs. Packet Switching / Packet Switched Networks
Unit Iii: 3.1 Circuit Switching vs. Packet Switching / Packet Switched Networks
Circuit switching vs. packet switching / Packet switched networks IP ARP RARP DHCP IC P !ueueing discip"ine Routing a"gorith#s RIP $%P& %u'netting CIDR Interdo#ain routing ()P Ipv* u"ticasting Congestion avoidance in network "a+er
In general switching can be divided into two categories namely circuit switching and packet switching. In circuit switching a dedicated physical link exists between a source and a destination, in this case data is sent as stream of bits. Packet switching is a communications method in which packets (discrete blocks of data) are routed between nodes over data links shared with other traffic. In each network node, packets are queued or buffered, resulting in variable delay. Packet switching is used to optimi e the use of the channel capacity available in digital telecommunication networks such as computer networks, to minimi e the transmission latency, and to increase robustness of communication. !he most well"known use of packet switching is the Internet and local area networks. !he Internet uses the Internet protocol suite over a variety of data link layer protocols. #or example, $thernet and frame relay are very common. %ewer mobile phone technologies also use packet switching. !he following paradigms are available for packet switching o 0irtua" Circuit %witching& ' connection is setup before the packets are transmitted. 'll the packets follow the same path. !he connection could either be permanent (manually setup by network administrator) or switched (dynamically setup through control signals).
CS2302 COMPUTER NETWORKS (UNIT III) 1
o Datagra# %witching& %o connection is setup each packet is forwarded independent of the other. 'n initial setup phase is used to set up a route between the intermediate nodes for all the packets passed during the session between the two end nodes. In each intermediate node, an entry is registered in a table to indicate the route for the connection that has been set up. !hus, packets passed through this route, can have short headers, containing only a virtual circuit identifier (()I), and not their destination. $ach intermediate node passes the packets according to the information that was stored in it, in the setup phase. In this way, packets arrive at the destination in the correct sequence, and it is guaranteed that essentially there will not be errors. !his approach is slower than )ircuit *witching, since different virtual circuits may compete over the same resources, and an initial setup phase is needed to initiate the circuit. 's in )ircuit *witching, if an intermediate node fails, all virtual circuits that pass through it are lost. !he most common forms of (irtual )ircuit networks are +.,- and #rame .elay, which are commonly used for public data networks (P/%). +.,- is a notable use of packet switching in that, despite being based on packet switching methods, it provided virtual circuits to the user. !hese virtual circuits carry variable"length packets. +.,- was used to provide the first international and commercial packet switching network, the International Packet *witched *ervice (IP**). 'synchronous !ransfer 0ode ('!0) also is a virtual circuit technology, which uses fixed"length cell relay connection oriented packet switching. /atagram packet switching is also called connectionless networking because no connections are established. !echnologies such as 0ultiprotocol 1abel *witching (0P1*) and the .esource .eservation Protocol (.*(P) create virtual circuits on top of datagram networks. (irtual circuits are especially useful in building robust failover mechanisms and allocating bandwidth for delay" sensitive applications. 0P1* and its predecessors, as well as '!0, have been called 2fast packet2 technologies. 0P1*, indeed, has been called 2'!0 without cells2. 0odern routers, however, do not require these technologies to be able to forward variable"length packets at multigigabit speeds across the network. !his approach uses a different, more dynamic scheme, to determine the route through the network links. $ach packet is treated as an independent entity, and its header contains full information about the destination of the packet. !he intermediate nodes examine the header of the packet, and decide to which node to send the packet so that it will reach its destination. In the decision two factors are taken into account&
!he shortest way to pass the packet to its destination " protocols such as .IP34*P# is used to determine the shortest path to the destination. #inding a free node to pass the packet to " in this way, bottle necks are eliminated, since packets can reach the destination in alternate routes.
C.S.ANITA ASSOC.PROF/CSE RMDEC
!hus, in this method, the packets don5t follow a pre"established route, and the intermediate nodes (the routers) don5t have pre"defined knowledge of the routes that the packets should be passed through. Packets can follow different routes to the destination, and delivery is not guaranteed (although packets usually do follow the same route, and are reliably sent). /ue to the nature of this method, the packets can reach the destination in a different order than they were sent, thus they must be sorted at the destination to form the original message. !his approach is time consuming since every router has to decide where to send each packet. !he main implementation of /atagram *witching network is the Internet which uses the IP network protocol.
*witching at the network layer in the Internet is done using the datagram approach to packet switching. !he communication at the network layer in the Internet is connectionless. !he #igure 6.7., shows how datagram approach can be used for delivering four packets from station ' to station +. It could be viewed that though all the packets belong to the same message they can take different paths to reach their destination.
,.1 IP
,.1.- 2hat Is an Internetwork3
8e use the term 4internetwork56 or so#eti#es 7ust 4internet6 with a lowercase i, to refer to an ar'itrar+ co""ection o8 networks interconnected to provide so#e sort o8 host9to9 host packet de"iver+ service. #or example, a corporation with many sites might construct a private internetwork by interconnecting the 1'%s at their different sites with point"to"point links leased from the phone company. 8hen we are talking about the widely used, global internetwork to which a large percentage of networks are now connected, we call it the 4Internet6 with a capita" I. #igure 6.,.7 shows an example internetwork. 'n internetwork is often referred to as a 9network of networks: because it is made up of lots of smaller networks. In this figure, we see $thernets, an #//I ring, and a point"to"point link. $ach of these is a single"technology network.
,.1.1 %ervice
4
ode"
C.S.ANITA ASSOC.PROF/CSE RMDEC
;sing IP, we can provide a host"to"host service. !he IP service model can be thought of as having two parts& an addressing sche#e5 which provides a wa+ to identi8+ a"" hosts in the internetwork5 and a datagra# <connection"ess= #ode" o8 data de"iver+. !his service model is sometimes called best effort (unreliable service) because, although IP makes every effort to deliver datagrams, it makes no guarantees. ,.1.1.- Datagra# De"iver+ !he IP datagram is fundamental to the Internet Protocol. ' datagram is a type of packet that happens to be sent in a connectionless manner over a network. $very datagram carries enough information to let the network forward the packet to its correct destination< there is no need for any advance setup mechanism to tell the network what to do when the packet arrives. =ou >ust send it, and the network makes its best effort to get it to the desired destination. !he 9best"effort: part means that if something goes wrong and the packet gets lost, corrupted, misdelivered, or in any way fails to reach its intended destination, the network does nothing?it made its best effort, and that is all it has to do. It does not make any attempt to recover from the failure. !his is sometimes called an unreliable service. @est"effort delivery does not >ust mean that packets can get lost. *ometimes they can get delivered out of order, and sometimes the same packet can get delivered more than once. !he higher"level protocols or applications that run above IP need to be aware of all these possible failure modes. Packet &or#at !he IP datagram, like most packets, consists of a header followed by a number of bytes of data. !he format of the header is shown in #igure 6.,.,
&ig. ,.1.1 IPv> Packet Header 0ersion. !he 0ersion 8ie"d specifies the version of IP. !he current version of IP is A, and it is sometimes called IPvA. H?en & !he next field, H?en5 specifies the length of the header in 6,"bit words. 8hen there are no options, which is most of the time, the header is - words (,B bytes) long. T$% & !he C"bit T$% <type of service) field has had a number of different definitions over the years, but its basic function is to allow packets to be treated differently based on application needs. #or example, the !4* value might determine whether or not a packet should be placed in a special queue that receives low delay. ?ength & !he next 7D bits of the header contain the ?ength of the datagram, including the header. ;nlike the E1en field, the 1ength field counts bytes rather than words. !hus, the maximum si e of an IP datagram is D-,-6- bytes. !he physical network over which IP is running, however, may not support such long packets. #or this reason, IP supports a 8rag#entation and reasse#'"+ process. !he second word of the header contains information about fragmentation, and the details of its use are presented under 9#ragmentation and .eassembly: below.
6 C.S.ANITA ASSOC.PROF/CSE RMDEC
TT? & 0oving on to the third word of the header, the next byte is the TT? <ti#e to "ive= field. Its name reflects its historical meaning rather than the way it is commonly used today. !he intent of the field is to catch packets that have been going around in routing loops and discard them, rather than let them consume resources indefinitely. 4riginally, !!1 was set to a specific number of seconds that the packet would be allowed to live, and routers along the path would decrement this field until it reached B. Eowever, since it was rare for a packet to sit for as long as 7 second in a router, and routers did not all have access to a common clock, most routers >ust decremented the !!1 by 7 as they forwarded the packet. !hus, it became more of a hop count than a timer, which is still a perfectly good way to catch packets that are stuck in routing loops. 4ne subtlety is in the initial setting of this field by the sending host& *et it too high and packets could circulate rather a lot before getting dropped< set it too low and they may not reach their destination. !he value DA is the current default. Ident . It allows the destination host to determine which datagram a newly arrived fragment belongs to. 'll the fragment of a datagram contain the same identification value &"ags . /# F /onGt fragment, 0#" 0ore fragment $88set .0ax C7H, fragment per datagram Protoco" & !his field is simply a demultiplexing key that identifies the higher"level protocol to which this IP packet should be passed. !here are values defined for !)P (D), ;/P (7I), and many other protocols that may sit above IP in the protocol graph. Checksu# & !his field is calculated by considering the entire IP header as a sequence of 7D"bit words, adding them up using ones complement arithmetic, and taking the ones complement of the result. !hus, if any bit in the header is corrupted in transit, the checksum will not contain the correct value upon receipt of the packet. *ince a corrupted header may contain an error in the destination address?and, as a result, may have been misdelivered?it makes sense to discard any packet that fails the checksum. It should be noted that this type of checksum does not have the same strong error detection properties as a ).), but it is much easier to calculate in software.
!he last two required fields in the header are the %ourceAddr and the DestinationAddr 8or the packet. !he latter is the key to datagram delivery& $very packet contains a full address for its intended destination so that forwarding decisions can be made at each router. !he source address is required to allow recipients to decide if they want to accept the packet and to enable them to reply. #inally, there may be a number of options at the end of the header. !he presence or absence of options may be determined by examining the header length (E1en) field. 8hile options are used fairly rarely, a complete IP implementation must handle them all. &rag#entation and Reasse#'"+ 4ne of the problems of providing a uniform host"to"host service model over a heterogeneous collection of networks is that each network technology tends to have its own idea of how large a packet can be. #or example, an $thernet can accept packets up to 7-BB bytes long, while #//I packets may be A-BB bytes long. !his leaves two choices for the IP service model& make sure that all IP datagrams are small enough to fit inside one packet on any network technology, or provide a means by which packets can be fragmented and reassembled when they are too big to go over a given network technology. !he central idea here is that every network type has a maximum transmission unit < TU=5 which is the largest IP datagram that it can carry in a frame. 8hen a host sends an IP datagram, therefore, it can choose any si e that it wants. ' reasonable choice is the 0!; of the network to which the host is directly attached. !hen fragmentation will only be necessary if the path to the destination includes a network with a smaller 0!;. *hould the transport protocol that sits on top of IP give IP a packet larger than the local 0!;, however, then the source host must fragment it. #ragmentation typically occurs in a router when it receives a datagram that it wants to forward over a network that has an 0!; that is smaller than the received datagram. !o enable these fragments to be reassembled at the receiving host, they all carry the same identifier in the Ident 8ie"d. !his identifier is chosen by the sending host and is intended to be unique among all the
8 C.S.ANITA ASSOC.PROF/CSE RMDEC
datagrams that might arrive at the destination from this source over some reasonable time period. *ince all fragments of the original datagram contain this identifier, the reassembling host will be able to recogni e those fragments that go together. *hould all the fragments not arrive at the receiving host, the host gives up on the reassembly process and discards the fragments that did arrive. IP does not attempt to recover from missing fragments.
$very IP address consists of two parts, one identifying the network and the other identifying the node. !he )lass of the address and the subnet mask determine which part belongs to the network address and which part belongs to the node address.
There are A di88erent address c"asses na#e"+ A5 (5 C5 D and B. It is possible to determine to which class a given IP address belong to by examining the most significant four bits of the IP address.
C"ass A addresses begin with C@@@, or - to -1D decimal. C"ass ( addresses begin with -C@@, or -1E to -F- decimal. C"ass C addresses begin with --C@, or -F1 to 11, decimal. C"ass D addresses begin with ---C, or 11> to 1,F decimal. C"ass B addresses begin with ----, or 1>C to 1AA decimal.
!he class of the IP address determines the default number of bits used for the network identification and host identification within the network. !he netid and the hostid bytes for all the classes are shown in the #igure 6.,.A.
10
)lass ' networks have I bits for the network part and ,A bits for the host part.!here can be only 7,D ( B and 7,I are reserved) )lass ' networks. $ach of them can accommodate , ,A ", hosts. )lass ' addresses were designed for large organi ations with large number of hosts or routers attached to their network. )lass @ networks have 7A bits for the network part and7D bits for the host part. )lass @ networks can accommodate D-,-6A hosts. )lass @ addresses were designed for midsi e organi ations that may have tens of thousands of hosts or routers attached to their networks. )lass ) networks have C bits for the network part and ,7 bits for the host part. )lass ) networks can accommodate only ,-D hosts. )lass ) addresses were designed for small organi ations with a small number of hosts or routers attached to their network. !here is >ust one block of )lass / addresses, which is designed for multicasting. !here is >ust one block of )lass $ addresses, which is designed for use as reserved addresses.
,., ADDRB%%
11
APPIN)
C.S.ANITA ASSOC.PROF/CSE RMDEC
'n internet is made of a combination of physical networks connected by internetworking devices such as routers. ' packet starting from a source host may pass through several different physical networks before finally reaching the destination host. !he hosts and routers are recogni ed at the network level by their logical (IP) addresses. Eowever, packets pass through physical networks to reach these hosts and routers. 't the physical level, the hosts and routers are recogni ed by their physical addresses. ' physical address is a local address. Its >urisdiction is a local network. It must be unique locally, but is not necessarily unique universally. It is called a physical address because it is usually (but not always) implemented in hardware. 'n example of a physical address is the AC"bit 0') address in the $thernet protocol, which is imprinted on the %I) installed in the host or router. !he physical address and the logical address are two different identifiers. 8e need both because a physical network such as $thernet can have two different protocols at the network layer such as IP and IP+ (%ovell) at the same time. 1ikewise, a packet at a network layer such as IP may pass through different physical networks such as $thernet and 1ocal!alk ('pple). !his means that delivery of a packet to a host or a router requires two levels of addressing& logical and physical. 8e need to be able to #ap a "ogica" address to its corresponding ph+sica" address and vice versa. !hese can be done by using either static or d+na#ic #apping. %tatic #apping involves in the creation of a table that associates a logical address with a physical address. !his table is stored in each machine on the network. $ach machine that knows, for example, the IP address of another machine but not its physical address can look it up in the table. !his has some limitations because physical addresses may change in the following ways& 7. ' machine could change its %I), resulting in a new physical address. ,. In some 1'%s, such as 1ocal!alk, the physical address changes every time the computer is turned on. 6. ' mobile computer can move from one physical network to another, resulting in a change in its physical address. !o implement these changes, a static mapping table must be updated periodically. !his overhead could affect network performance.
12 C.S.ANITA ASSOC.PROF/CSE RMDEC
In d+na#ic #apping each time a machine knows one of the two addresses (logical or physical), it can use a protocol to find the other one.
13
address. %ow system ' can send all the packets it has for this destination by using the physical address it received.
#igure 6.6.7 ARP operation Cache Memory ;sing '.P is inefficient if system ' needs to broadcast an '.P request for each IP packet it needs to send to system @. It could have broadcast the IP packet itself. '.P can be useful if the '.P reply is cached (kept in cache memory for a while) because a system normally sends several packets to the same destination. ' system that receives an '.P reply stores the mapping in the cache memory and keeps it for ,B to 6B minutes unless the space in the cache is exhausted. @efore sending an '.P request, the system first checks its cache to see if it can find the mapping.
14
Pac et !ormat
#igure 6.6., shows the format of an '.P packet for mapping IP address into $thernet addresses. The 8ie"ds are as 8o""ows. Hardware t+pe . !his is a 7D"bit field defining the type of the network on which '.P is running. $ach 1'% has been assigned an integer based on its type. #or example, $thernet is given type 7. '.P can be used on any physical network. Protoco" t+pe . !his is a 7D"bit field defining the protocol. #or example, the value of this field for the IPvA protocol is BCBB7D, '.P can be used with any higher"level protocol. H?en<4 hardware6 address "ength = and P?en<4 protoco"6 address "ength =. !hese fields specify the length of the link"layer address and higher"layer protocol address respectively.
15
"nca#sulation 'n '.P packet is encapsulated directly into a data link frame. #or example, an '.P packet can be encapsulated in an $thernet frame. %ote that the type field indicates that the data carried by the frame are an '.P packet. $#eration 1et us see how '.P functions on a typical internet. #irst we describe the steps involved. !hen we discuss the four cases in which a host or router needs to use '.P. !hese are the steps involved in an '.P process& 7. !he sender knows the IP address of the target. 8e will see how the sender obtains this shortly. ,. IP asks '.P to create an '.P request message, filling in the sender physical address, the sender IP address, and the target IP address. !he target physical address field is filled with 4s. 6. !he message is passed to the data link layer where it is encapsulated in a frame by using the physical address of the sender as the source address and the physical broadcast address as the destination address. A. $very host or router receives the frame. @ecause the frame contains a broadcast destination address, all stations remove the message and pass it to '.P. 'll machines except the one targeted drop the packet. !he target machine recogni es its IP address. -. !he target machine replies with an '.P reply message that contains its physical address. !he message is unicast. D. !he sender receives the reply message. It now knows the physical address of the target machine. I. !he IP datagram, which carries data for the target machine, is now encapsulated in a frame and is unicast to the destination.
16 C.S.ANITA ASSOC.PROF/CSE RMDEC
Proxy%&P ' technique called proxy '.P is used to create a subnetting effect. ' proxy '.P is an '.P that acts on behalf of a set of hosts. 8henever a router running a proxy '.P receives an '.P request looking for the IP address of one of these hosts, the router sends an '.P reply announcing its own hardware (physical) address. 'fter the router receives the actual IP packet, it sends the packet to the appropriate host or router.
,.>
!here are occasions in which a host knows its physical address, but needs to know its logical address. !his may happen in two cases& 7. ' diskless station is >ust booted. !he station can find its physical address by checking its interface, but it does not know its IP address. ,. 'n organi ation does not have enough IP addresses to assign to each station< it needs to assign IP addresses on demand. !he station can send its physical address and ask for a short time lease.
3.'.1 &%&P
.everse 'ddress .esolution Protocol (.'.P) finds the logical address for a machine that knows only its physical address. $ach host or router is assigned one or more logical (IP) addresses, which are unique and independent of the physical (hardware) address of the machine. !o create an IP datagram, a host or a router needs to know its own IP address or addresses. !he IP address of a machine is usually read from its configuration file stored on a disk file. Eowever, a diskless machine is usually booted from .40, which has minimum booting information. !he .40 is installed by the manufacturer. It cannot include the IP address because the IP addresses on a network are assigned by the network administrator. !he machine can get its physical address (by reading its %I), for example), which is unique locally. It can then use the physical address to get the logical address by using the .'.P protocol. ' .'.P request is created and broadcast on the local network. 'nother machine on the local network that knows all
17 C.S.ANITA ASSOC.PROF/CSE RMDEC
the IP addresses will respond with a .'.P reply. !he requesting machine must be running a .'.P client program< the responding machine must be running a .'.P server program. !here is a serious problem with .'.P& @roadcasting is done at the data link layer. !he physical broadcast address, all is in the case of $thernet, does not pass the boundaries of a network. !his means that if an administrator has several networks or several subnets, it needs to assign a .'.P server for each network or subnet. !his is the reason that .'.P is almost obsolete. Protocols like @44!P and /E)P, are replacing .'.P. B$$(P !he @ootstrap Protocol (@44!P) is a client3server protocol designed to provide physical address to logical address mapping. @44!P is an application layer protocol. !he administrator may put the client and the server on the same network or on different networks .@44!P messages are encapsulated in a ;/P packet, and the ;/P packet itself is encapsulated in an IP packet.
/E)P relies on the existence of a /E)P server that is responsible for providing configuration information to hosts. *ince the goal of /E)P is to minimi e the amount of manual configuration required for a host to function, it would rather defeat the purpose if each host had to be configured with the address of a /E)P server. !hus, the first problem faced by /E)P is that of server discovery. !o contact a /E)P server, a newly booted or attached host sends a /E)P/I*)4($. message to a special IP address (,--.,--.,--.,--) that is an IP broadcast address. !his means it will be received by all hosts and routers on that network. (.outers do not forward such packets onto
18 C.S.ANITA ASSOC.PROF/CSE RMDEC
other networks, preventing broadcast to the entire Internet.) In the simplest case, one of these nodes is the /E)P server for the network. !he server would then reply to the host that generated the discovery message (all the other nodes would ignore it). Eowever, it is not really desirable to require one /E)P server on every network because this still creates a potentially large number of servers that need to be correctly and consistently configured. !hus, /E)P uses the concept of a relay agent. !here is at least one relay agent on each network, and it is configured with >ust one piece of information& the IP address of the /E)P server. 8hen a relay agent receives a /E)P/I*)4($. message, it unicasts it to the /E)P server and awaits the response, which it will then send back to the requesting client. !he process of relaying a message from a host to a remote /E)P server is shown in #igure 6.-.7.
&ig ,.A.- A DHCP re"a+ agent receives a 'roadcast DHCPDI%C$0BR #essage 8ro# a host and sends a unicast DHCPDI%C$0BR to the DHCP server
#igure 6.-., shows the format of a /E)P message. !he message is actually sent using a protocol called ;/P (the ;ser /atagram Protocol) that runs over IP. /E)P is derived from an earlier protocol called @44!P, and some of the packet fields are thus not strictly relevant to host configuration. 8hen trying to obtain configuration information, the client puts its hardware address (e.g., its $thernet address) in the chaddr field. !he /E)P server replies by filling in the yiaddr (9your: IP address) field and sending it to the client. 4ther information such as the default router to be used by this client can be included in the options field. In the case where /E)P dynamically assigns IP addresses to hosts, it is clear that hosts cannot keep addresses indefinitely, as this would eventually cause the server to exhaust its address pool. 't the same time, a host cannot be depended upon to give back its address, since it might have
20 C.S.ANITA ASSOC.PROF/CSE RMDEC
crashed, been unplugged from the network, or been turned off. !hus, /E)P allows addresses to be 9leased: for some period of time. 4nce the lease expires, the server is free to return that address to its pool. ' host with a leased address clearly needs to renew the lease periodically if in fact it is still connected to the network and functioning correctly. %ote that /E)P may also introduce some more complexity into network management, since it makes the binding between physical hosts and IP addresses much more dynamic.
essage Protoco"
8hen a router does not know how to forward the datagram or when one fragment of a datagram fails to arrive at the destination?it does not necessarily fail silently. IP is always configured with a companion protocol, known as the Internet )ontrol 0essage Protocol (I)0P). IC P de8ines a co""ection o8 error #essages that are sent back to the source host whenever a router or host is unable to process an IP datagram successfully. #or example, I)0P defines error messages indicating that the destination host is unreachable (perhaps due to a link failure), that the reassembly process failed, that the !!1 had reached B, that the IP header checksum failed, and so on. IC P a"so de8ines a hand8u" o8 contro" #essages that a router can send back to a source host. 4ne of the most useful control messages, called an I)0P".edirect, tells the source host that there is a better route to the destination.
It also directly affects the latency experienced by a packet, by determining how long a packet waits to be transmitted. !here are two common queuing algorithms namely 7. first"in"first"out (#I#4) ,. fair queuing (#J) ,.D.- &I&$ !he idea of #I#4 queuing, also called first"come"first"served (#)#*) queuing, is simple& !he first packet that arrives at a router is the first packet to be transmitted. !his is illustrated in #igure 6.I.7(a), which shows a #I#4 with 9slots: to hold up to eight packets. Kiven that the amount of buffer space at each router is finite, if a packet arrives and the queue (buffer space) is full, then the router discards that packet, as shown in #igure 6.I.7(b). !his is done without regard to which flow the packet belongs to or how important the packet is. !his is sometimes called tail dro#, since packets that arrive at the tail end of the #I#4 are dropped.
22
&igure ,.D.- <a= &I&$ /ueuing; <'= tai" drop at a &I&$ /ueue.
#I#4 is a scheduling discipline?it determines the order in which packets are transmitted. !ail drop is a drop policy?it determines which packets get dropped. ' simple variation on basic #I#4 queuing is priorit+ /ueuing.
23
!he idea is to mark each packet with a priority. !he routers then implement multiple #I#4 queues, one for each priority class.
C.S.ANITA ASSOC.PROF/CSE RMDEC
!he router always transmits packets out of the highest"priority queue if that queue is nonempty before moving on to the next priority queue. 8ithin each priority, packets are managed in a #I#4 manner.
Draw'ack with priorit+ /ueuing is that the high"priority queue can starve out all the other queues. ,.D.1 &air !ueuing ain pro'"e# with &I&$ /ueuing It does not discriminate between different traffic sources. It does not separate packets according to the flow to which they belong.
&air /ueuing <&!= is an algorithm that has been proposed to address this problem. (asic idea o8 &! !o maintain a separate queue for each flow currently being handled by the router. !he router then services these queues in a round"robin manner, as illustrated in #igure 6.I.,. 8hen a flow sends packets too quickly, then its queue fills up. 8hen a queue reaches a particular length, additional packets belonging to that flowGs queue are discarded. Eence, a given source cannot arbitrarily increase its share of the networkGs capacity at the expense of other flows.
24
&or e@a#p"e5 'ssume a router is managing two flows, one with 7BBB"byte packets and the other with -BB"byte packets , then a simple round"robin servicing of packets from each flowGs queue will give the first flow two"thirds of the linkGs bandwidth and the second flow only one"third of its bandwidth. 8hat we really want is bit"by"bit round"robin< that is, the router transmits a bit from flow 7, then a bit from flow ,, and so on. )learly, it is not feasible to interleave the bits from different packets.!he #J mechanism therefore simulates this behavior by first determining when a given packet would finish being transmitted if it were being sent using bit"by"bit round robin, and then using this finishing time to sequence the packets for transmission. A"gorith# &or Appro@i#ating (it9(+9(it Round Ro'in 1et Pi denote the length of packet i 1et )i denote the time when the router starts to transmit packet i , 1et !i denote the time when the router finishes transmitting packet i.
25 C.S.ANITA ASSOC.PROF/CSE RMDEC
!i : )i G Pi . 2hen do we start trans#itting packet i3 !his depends on whether packet i arrived before or after the router finished transmitting packet i F 7 from this flow. If it was before, then logically the first bit of packet i is transmitted immediately after the last bit of packet i L7. 4n the other hand, it is possible that the router finished transmitting packet i L7 long before i arrived, meaning that there was a period of time during which the queue for this flow was empty, so the round"robin mechanism could not transmit any packets from this flow. 1et %i denote the time that packet i arrives at the router, then )i : #a@<!iH-5 %i =. !hus, we can compute !i : #a@<!iH-5 %i = G Pi
&igure ,.D., B@a#p"e o8 8air /ueuing in action. <a= shorter packets are sent 8irst; <'= send9 ing o8 "onger packet5 a"read+ in progress5 is co#p"eted 8irst. #or every flow, calculate Fi for each packet that arrives using the above formula. !reat all the Fi as timestamps, and the next packet to transmit is always the packet that has the lowest timestamp. Note &
26 C.S.ANITA ASSOC.PROF/CSE RMDEC
7. ' packet can arrive on a flow, and because it is shorter than a packet from some other flow that is already in the queue waiting to be transmitted, it can be inserted into the queue in front of that longer packet. ,. ' newly arriving packet cannot preempt a packet that is currently being transmitted. &or e@a#p"e in &igure ,.D.,. Part (a) shows the queues for two flows< the algorithm selects both packets from flow 7 to be transmitted before the packet in the flow , queue. In (b), the router has already begun to send a packet from flow , when the packet from flow 7 arrives. !hough the packet arriving on flow 7 would have finished before flow , if we had been using perfect bit"by"bit fair queuing, the implementation does not preempt the flow , packet. Two 8eatures o8 8air /ueuing. 1ink is never left idle as long as there is at least one packet in the queue. 'ny queuing scheme with this characteristic is said to be work-conserving. If the link is fully loaded and there are n flows sending data, we cannot use more than 73nth of the link bandwidth. #J is a scheduling algorithm, which, like #I#4, may be combined with various drop policies. ' variation of #J, called *ei+hted ,air queuin+ <2&!=5 allows a weight to be assigned to each flow (queue). !his weight logically specifies how many bits to transmit each time the router services that queue, which effectively controls the percentage of the linkGs bandwidth that flow will get. *imple #J gives each queue a weight of 7, which means that logically only 7 bit is transmitted from each queue each time around. !his results in each flow getting 73 nth of the bandwidth when there are n flows. 8ith 8#J, however, one queue might have a weight of ,, a second queue might have a weight of 7, and a third queue might have a weight of 6.
,.E Routing
Di88erence 'etween 8orwarding and routing.
27 C.S.ANITA ASSOC.PROF/CSE RMDEC
&orwarding consists of taking a packet, looking at its destination address, consulting a table, and sending the packet in a direction determined by that table. Routing is the process by which forwarding tables are built.
!he forwarding table is used when a packet is being forwarded and so must contain enough information to accomplish the forwarding function. !his means that a row in the forwarding table contains the mapping from a network number to an outgoing interface and some 0') information, such as the $thernet address of the next hop. !he routing table, is the table that is built up by the routing algorithms as a precursor to building the forwarding table. It generally contains mappings from network numbers to next hops.
Ta'"e ,.E.- B@a#p"e rows 8ro# <a= routing and <'= 8orwarding ta'"es. ,.E.- Network as a )raph #igure 6.C.7 shows a graph representing a network. !he nodes of the graph, labeled ' through #, may be either hosts5 switches5 routers5 or networks. 1et us assume that the nodes are routers. !he edges of the graph correspond to the network "inks.
28
$ach edge has an associated cost, which gives some indication of the desirability of sending traffic over that link.
&igure ,.E.- Network represented as a graph. Need 8or a routing a"gorith# !he basic problem of routing is to find the lowest"cost path between any two nodes, where the cost of a path equals the sum of the costs of all the edges that make up the path. #or a simple network like the one in #igure 6.C.7, you could imagine >ust calculating all the shortest paths and loading them into some nonvolatile storage on each node. *uch a static approach has several shortcomings& ! It does not deal with node or link failures. ! It does not consider the addition of new nodes or links. It implies that edge costs cannot change. Routing Protoco" !hese protocols provide a distributed, dynamic way to solve the problem of finding the lowest" cost path in the presence of link and node failures and changing edge costs. !wo main classes of routing protocols& -. Distance vector routing. 1. ?ink state routing.
2 C.S.ANITA ASSOC.PROF/CSE RMDEC
,.E.1 Distance 0ector <RIP= 7. $ach node constructs a one"dimensional array (a vector) containing the 9distances: (costs) to all other nodes and distributes that vector to its immediate neighbors. ,. $ach node knows the cost of the link to each of its directly connected neighbors. 6. ' link that is down is assigned an infinite cost.
&igure ,.E.1 Distance9vector routing. an e@a#p"e network. In this network , the cost of each link is set to 7. 8e can represent each nodeGs knowledge about the distances to all other nodes as follows.
30
31
Ta'"e ,.E.1<'= Initia" routing ta'"e at node A. !able 6.C.,.(a) has a list of distances from one node to all other nodes. Initially, each node sets a cost of 7 to its directly connected neighbors and " to all other nodes. !hus, ' initially believes that it can reach @ in one hop and that / is unreachable. !he routing table stored at ' reflects this set of beliefs and includes the name of the next hop that ' would use to reach any reachable node. Initially, then, 'Gs routing table would look like !able 6.C.,(b). !he next step in distance"vector routing is that ever+ node sends a #essage to its direct"+ connected neigh'ors containing its persona" "ist o8 distances . #or example, node # tells node ' that it can reach node K at a cost of 7< ' also knows it can reach # at a cost of 7, so it adds these costs to get the cost of reaching K by means of #. !his total cost of , is less than the current cost of infinity, so ' records that it can reach K at a cost of , by going through #. *imilarly, ' learns from ) that / can be reached from ) at a cost of 7< it adds this to the cost of reaching ) (7) and decides that / can be reached via ) at a cost of ,, which is better than the old cost of infinity. 't the same time, ' learns from ) that @ can be reached from ) at a cost of 7, so it concludes that the cost of reaching @ via ) is ,. *ince this is worse than the current cost of reaching @ (7), this new information is ignored. 't this point, ' can update its routing table with costs and next hops for all nodes in the network. !he result is shown in !able 6.C.,(c).
32
,.E., Routing In8or#ation Protoco" <RIP= 4ne of the most widely used routing protocols in IP networks is the Routing In8or#ation Protoco" (.IP). It is also extremely simple. .IP is the canonical example of a routing protocol built on the distance"vector algorithm . In an internetwork, the goal of the routers is to learn how to forward packets to various networks. #or example, in #igure 6.C.6(a), router ) would advertise to router ' the fact that it can reach networks , and 6 (to which it is directly connected) at a cost of B< networks - and D at cost 7< and network A at cost ,.
&igure ,.E.,<a= B@a#p"e network running RIP. !he RIP packet 8or#at in #igure 6.C.6(b).
34
,.E.> ?ink %tate <$%P&= $ach node is assumed to be capable of finding out the state of the link to its neighbors (up or down) and the cost of each link. 'gain, we want to provide each node with enough information to enable it to find the least"cost path to any destination.
The 'asic idea o8 "ink9state protoco"s . 7. $very node knows how to reach its directly connected neighbors. ,. 0ake sure that the totality of this knowledge is disseminated to every node, then every node will have enough knowledge of the network to build a complete map of the network. ?ink9state routing protoco"s re"+ on two #echanis#s& 7. .eliable dissemination of link"state information
35 C.S.ANITA ASSOC.PROF/CSE RMDEC
,. )alculation of routes from the sum of all the accumulated link"state knowledge. Re"ia'"e &"ooding .eliable flooding is the process of making sure that all the nodes participating in the routing protocol get a copy of the link"state information from all the other nodes. ' node sends its link"state information out on all of its directly connected links, with each node that receives this information forwarding it out on all of its links. !his process continues until the information has reached all the nodes in the network. ?ink %tate Packet<?%P= $ach node creates an update packet, also called a link"state packet (1*P), that contains the following information& 7. !he I/ of the node that created the 1*P ,. ' list of directly connected neighbors of that node, with the cost of the link to each one 6. ' sequence number A. ' time to live for this packet. 7 and , enable route calculation. 6 and A are used to make the process of flooding the packet to all nodes reliable. How does 8"ooding work3
&igure ,.E.> &"ooding o8 "ink9state packets. <a= ?%P arrives at node I; <'= I 8"oods ?%P
36 C.S.ANITA ASSOC.PROF/CSE RMDEC
to A and C; <c= A and C 8"ood ?%P to ( <'ut not I=; <d= 8"ooding is co#p"ete. )onsider a node + that receives a copy of an 1*P that originated at some other node =. %ote that = may be any other router in the same routing domain as +. + checks to see if it has already stored a copy of an 1*P from =. If not, it stores the 1*P. If it already has a copy, it compares the sequence numbers< if the new 1*P has a larger sequence number, it is assumed to be the more recent, and that 1*P is stored, replacing the old one. ' smaller (or equal) sequence number would imply an 1*P older (or not newer) than the one stored, so it would be discarded and no further action would be needed. If the received 1*P was the newer one, + then sends a copy of that 1*P to all of its neighbors except the neighbor from which the 1*P was >ust received. !he fact that the 1*P is not sent back to the node from which it was received helps to bring an end to the flooding of an 1*P. *ince + passes the 1*P on to all its neighbors, who then turn around and do the same thing, the most recent copy of the 1*P eventually reaches all nodes. 2hen are ?%Ps generated<created=3 7. 8hen a periodic timer expires. ,. !here is a change in topology . )oa" o8 "ink9state routing !he newest information must be flooded to all nodes as quickly as possible. !he old information must be removed from the network and not allowed to circulate. Use o8 se/uence nu#'ers To #ake sure that o"d in8or#ation is rep"aced '+ newer in8or#ation5 ?%Ps carr+ se/uence nu#'ers. $ach time a node generates a new 1*P, it increments the sequence number by 7. If a node goes down and then comes back up, it starts with a sequence number of B. If the node was down for a long time, all the old 1*Ps for that node will have timed out . Use o8 ti#e to "ive !his is used to ensure that old link"state information is eventually removed from the network. ' node always decrements the !!1 of a newly received 1*P before flooding it to its neighbors. It also 9ages: the 1*P while it is stored in the node. 8hen the !!1 reaches B, the node refloods the 1*P with a !!1 of B, which is interpreted by all the nodes in the network as a signal to delete that 1*P.
1et N denote the set of nodes in the graph. 1et "<i5 7 = denote the nonnegative cost (weight) associated with the edge between nodes i, > # %, 1et "<i5 7 = : if no edge connects i and > . In the following description, 1et s N denote this node, that is, the node executing the algorithm to find the shortest path to all the other nodes in %. !he algorithm maintains the following two varia'"es. 1et denote the set of nodes incorporated so far by the algorithm 1et C<n= denote the cost of the path from s to each node n. !he algorithm is defined as follows& : JsK 8or each n in N JsK C<n= : "<s5 n= whi"e <N L: = : JwK such that C<w= is the #ini#u# 8or a"" w in <N 8or each n in <N = C<n= : IN<C<n=5 C<w= G "<w5 n== The a"gorith# works as 8o""ows. 7. Initiali e the Con8ir#ed list with an entry for myself< this entry has a cost of B. ,. #or the node >ust added to the )onfirmed list in the previous step, call it node %ext, select its 1*P. 6. #or each neighbor (%eighbor) of %ext, calculate the cost ()ost) to reach this %eighbor as the sum of the cost from myself to %ext and from %ext to %eighbor. (a) If %eighbor is currently on neither the )onfirmed nor the Tentative list, then add (%eighbor, )ost, %extEop) to the !entative list, where %extEop is the direction I go to reach %ext. (b) If %eighbor is currently on the !entative list, and the )ost is less than the currently listed cost for %eighbor, then replace the current entry with (%eighbor, )ost, %extEop), where %extEop is the direction I go to reach %ext. A. If the !entative list is empty, stop. 4therwise, pick the entry from the !entative list with the lowest cost, move it to the )onfirmed list, and return to step ,.
38
Ta'"e ,.E.>.- %teps 8or 'ui"ding routing ta'"e 8or node D <&igure ,.E.>.-=.
40
Properties o8 the "ink9state routing a"gorith#. 7. It has been proven to stabili e quickly, ,. It does not generate much traffic, 6. It responds rapidly to topology changes or node failures.
Di88erence 'etween the distance9vector and "ink9state a"gorith#s. In distance vector, each node talks only to its directly connected neighbors, but it tells them everything it has learned (i.e., distance to all nodes). In link state, each node talks to all other nodes, but it tells them only what it knows for sure (i.e., only the state of its directly connected links).
,.E.A The $pen %hortest Path &irst Protoco" <$%P&= &eatures o8 $%P& 7. 'uthentication of routing messages. ,. 'dditional hierarchy. 6. 1oad balancing.
41
&igure ,.E.A <a= $%P& header 8or#at. !he (ersion field is currently set to ,. !he !ype field may take the values 7 through -. !he *ource'ddr identifies the sender of the message !he 'reaId is a 6,"bit identifier of the area in which the node is located. !he entire packet, except the authentication data, is protected by a 7D"bit checksum !he 'uthentication type is B if no authentication is used< otherwise it may be 7, implying a simple password is used, or ,, which indicates that a cryptographic authentication checksum. The 'asic 'ui"ding '"ock o8 "ink9state #essages in $%P& is known as the "ink9state advertise#ent <?%A=. 4ne message may contain many 1*'s.8e provide a few details of the 1*' in #igure 6.C.-(b). 1ike any internetwork routing protocol, 4*P# must provide information about how to reach networks.
42
,.F %u'netting !he network part in an IP address uniquely identifies exactly one physical network. !his approach has a couple of drawbacks.!he drawbacks are explained as follows& 7. !he problem is address assign#ent ine88icienc+& ' network with two nodes uses an entire class ) network address, thereby wasting ,-6 perfectly useful addresses< a class @ network with slightly more than ,-- hosts wastes over DA,BBB addresses. ,. !he #ore network nu#'ers there are in use, the 'igger the 8orwarding ta'"es get. @ig forwarding tables add cost to routers, and they are potentially slower to search than smaller tables for a given technology, so they degrade router performance. %u'netting provides an elegantly simple way to reduce the tota" nu#'er o8 network nu#'ers that are assigned. !he idea is to take a single IP network number and allocate the IP addresses with that network number to several physical networks(subnets). !he mechanism by which a single network number can be shared among multiple networks involves configuring all the nodes on each subnet with a su'net #ask. 8ith simple IP addresses, all hosts on the same network must have the same network number. Use o8 su'net #ask . !he subnet mask enables us to introduce a subnet number< all hosts on the same physical network will have the same subnet number, which means that hosts may be on different physical networks but share a single network number. #or example, *uppose that we want to share a single class @ address among several physical networks. 8e could use a subnet mask of ,--.,--.,--.B. !he top ,A bits (where the mask has 7s) are now defined to be the network number, and the lower C bits (where the mask has Bs) are the host number.
C.S.ANITA ASSOC.PROF/CSE RMDEC
43
&igure ,.F.1 An e@a#p"e o8 su'netting. Eost E7 in #igure 6.H., is configured with an address of 7,C.HD.6A.7- and a subnet mask
44 C.S.ANITA ASSOC.PROF/CSE RMDEC
of ,--.,--.,--.7,C. ('ll hosts on a given subnet are configured with the same mask< i.e., there is exactly one subnet mask per subnet.) !he bitwise '%/ of these two numbers defines the subnet number of the host and of all other hosts on the same subnet. In this case, 7,C.HD.6A.7- '%/ ,--.,--.,--.7,C equals 7,C.HD.6A.B, so this is the subnet number for the topmost subnet in the figure 6.H.,. %teps to 'e 8o""owed when a host wants to send a packet to a certain IP address. 7. !he host performs a bitwise '%/ between its own subnet mask and the destination IP address. ,. If the result equals the subnet number of the sending host, then it knows that the destination host is on the same subnet and the packet can be delivered directly over the subnet. 6. If the results are not equal, the packet need s to be sent to a router to be forwarded to another subnet. B@a#p"e& 7. If E7 is sending to E,, then E7 '%/s its subnet mask (,--.,--.,--.7,C) with the address for E, (7,C.HD.6A.76H) to obtain 7,C.HD.6A.7,C. ,. !his does not match the subnet number for E7 (7,C.HD.6A.B) so E7 knows that E, is on a different subnet. 6. *ince E7 cannot deliver the packet to E, directly over the subnet, it sends the packet to its default router .7. Mo' o8 a router in su'netting #or simple IP, a router has a forwarding table that consists of entries of the form (%etwork%um, %extEop). !o support subnetting, the forwarding table must now hold entries of the form (*ubnet%umber, *ubnet0ask, %extEop). !o find the right entry in the table, the router does the following& It '%/s the packetGs destination address with the *ubnet0ask for each entry in turn. If the result matches the *ubnet%umber of the entry, then this is the right entry to use, and it forwards the packet to the next hop router indicated. In the example network of #igure 6.H.,, router .7 would have the entries shown in !able 6.H.
45
Ta'"e ,.F B@a#p"e 8orwarding ta'"e with su'netting 8or &igure ,.F.1. The datagra# 8orwarding a"gorith# is as 8o""ows. / M destination IP address for each forwarding table entry (*ubnet%umber, *ubnet0ask, %extEop) /7 M *ubnet0ask N / if /7 M *ubnet%umber if %extEop is an interface deliver datagram directly to destination else deliver datagram to %extEop (a router) *ubnetting helps solve the scalability problems in two ways. 7. #irst, it i#proves the address assign#ent e88icienc+ by not letting to use up an entire class ) or class @ address every time we add a new physical network. ,. *econd, it helps to aggregate information. #rom a reasonable distance, a complex collection of physical networks can be made to look like a single network, so that the amount of information that routers need to store to deliver datagrams to those networks can be reduced.
,.-C C"ass"ess Routing <CIDR= C"ass"ess interdo#ain routing ()I/., pronounced 9cider:) is a technique that addresses two scaling concerns in the Internet& 7. !he growth o8 'ack'one routing ta'"es as more and more network numbers need to be stored in them,
C.S.ANITA ASSOC.PROF/CSE RMDEC
46
,. !he potential for the ,19'it IP address space to 'e e@hausted well before the four"billionth host is attached to the Internet. 6. Need 8or CIDR !he second point as mentioned above is the address assignment inefficiency.(eg) ' network with two hosts needs a c"ass C address, giving an address assignment efficiency of 1/1AA : C.DEN< a network with 1A* hosts needs a c"ass ( address, for an efficiency of only 1A*/*A5A,A : C.,FN. 'ny '* that requests a class @ address will not be given one unless they can show a need for something close to DAO addresses, and instead give them an appropriate number of class ) addresses to cover the expected number of hosts. *ince we would now be handing out address space in chunks of ,-D addresses at a time, we could more accurately match the amount of address space consumed to the si e of the '*. #or any '* with at least ,-D hosts (which means the ma>ority of '*s), we can guarantee an address utili ation of at least -BP, and typically much more. !his solution raises a problem& excessive storage requirements at the routers. If a single '* has, say, 7D class ) network numbers assigned to it, that means every Internet backbone router needs 7D entries in its routing tables for that '*. !his is true even if the path to every one of those networks is the same. If we had assigned a class @ address to the '*, the same routing information could be stored in one table entry. Eowever, our address assignment efficiency would then be only 7D Q ,--3D-,-6D M D.,P. )I/., therefore, tries to balance the desire to minimi e the number of routes that a router needs to know .!o do this, CIDR helps to a++re+ate routes. (!hat is, it uses a single entry in a forwarding table to tell us how to reach a lot of different networks) )onsider our hypothetical '* with 7D class ) network numbers. Instead of handing out 7D addresses at random, we can hand out a block of contiguous class ) addresses. *uppose we assign the class ) network numbers from 7H,.A.7D through 7H,.A.67. 4bserve that the top ,B bits of all the addresses in this range are the same (77BBBBBB BBBBB7BB BBB7). 8e now require a routing protocol that can deal with these 9classless: addresses, which means that it must understand that a network number may be of any length is required. !he network numbers that are carried in such a routing protocol are represented simply by (length, valueR pairs), where the length gives the number of bits in the network prefix ?,B in the above example. )onsider the example in #igure 6.7B. !he two corporations served by the provider network have been assigned ad>acent ,B" bit network prefixes. *ince both of the
C.S.ANITA ASSOC.PROF/CSE RMDEC
47
corporations are reachable through the same provider network, it can advertise a single route to both of them by >ust advertising the common 7H"bit prefix they share. In general, it is possible to aggregate routes repeatedly if addresses are assigned carefully. !his means that we need to pay attention to which
&igure ,.-C Route aggregation with CIDR. provider a corporation is attached to before assigning it an address if this scheme is to work. 4ne way to accomplish that is to assign a portion of address space to the provider and then to let the network provider assign addresses from that space to its customers. IP &orwarding Revisited )I/. means that prefixes may be of any length, from , to 6, bits. #urthermore, it is sometimes possible to have prefixes in the forwarding table that 9overlap,: in the sense that some addresses may match more than one prefix. #or example, we might find both 7I7.DH (a 7D"bit prefix) and 7I7.DH.7B (a ,A"bit prefix) in the forwarding table of a single router. In this case, a packet destined to, say, 7I7.DH.7B.- clearly matches both prefixes. !he rule in this case is based on the principle of 9longest match:< that is, the packet matches the longest prefix, which would be 7I7.DH.7B in this example. 4n the other hand, a packet destined to 7I7.DH.,B.- would match 7I7.DH and not 7I7.DH.7B, and in the absence of any other matching entry in the routing table, 7I7.DH would be the longest match. .
48
,.-- Interdo#ain Routing <()P= !he Internet is organi ed as autonomous systems, each of which is under the control of a single administrative entity. ' corporationGs complex internal network might be a single '*, as may the network of a single Internet service provider.
&igure ,.--.- A network with two autono#ous s+ste#s. #igure 6.77.7 shows a simple network with two autonomous systems. 'utonomous systems improves scalability. !he routing problem is divided into two parts& routing within a sing"e autono#ous s+ste# <intrado#ain routing= and routing 'etween autono#ous s+ste#s.<interdo#ain routing= $ach '* can run whatever intradomain routing protocols it chooses. $ne 8eature o8 the autono#ous s+ste#
C.S.ANITA ASSOC.PROF/CSE RMDEC
enables some '*s to dramatically reduce the amount of routing information they need to care about by using de,ault routes. #or example, if a corporate network is connected to the rest of the Internet by a single router (this router is typically called a border router since it sits at the boundary between the '* and the rest of the Internet) !here have been two ma>or interdomain routing protocols in the recent history of the Internet. !he first was the B@terior )atewa+ Protoco" <B)P=. $KP basically forced a treelike topology onto the Internet. !he replacement for $KP is the (order )atewa+ Protoco" <()P=. @KP assumes that the Internet is an arbitrarily interconnected set of '*s. 1 ?ocal tra,,ic as traffic that originates at or terminates on nodes within an '*. (ransit tra,,ic as traffic that passes through an '*. 8e can classify '*s into three types& )tu- %). an '* that has only a single connection to one other '*< such an '* will only carry local traffic. !he small corporation in #igure 6.77., is an example of a stub '*. Multihomed %). an '* that has connections to more than one other '* but that refuses to carry transit traffic< for example, the large corporation at the top of #igure 6.77.,. (ransit %). an '* that has connections to more than one other '* and that is designed to carry both transit and local traffic, such as the backbone providers in #igure 6.77.,.
8hy interdomain routing is hardS 'n Internet backbone router must be able to forward any packet destined anywhere in the Internet. !hat means having a routing table that will provide a match for any valid IP address. !he second challenge in interdomain routing arises from the autonomous nature of the domains. !he third challenge involves the issue of trust. Provider ' might be unwilling to believe certain advertisements from provider @ for fear that provider @ will advertise erroneous routing information.
,.-1 IP 0ersion * <IPv*= Need 8or IPv* !he motivation for a new version of IP is to deal with scaling problems caused by the InternetGs massive growth. %u'netting and CIDR have helped in the address dep"etion pro'"e# and the routing in8or#ation pro'"e#. Eowever, there will come a point at which these techniques are no longer adequate. !he address space will be exhausted well before the four"billionth host is connected to the Internet. 'll of these possibilities argue that a bigger address space than that provided by 6, bits will eventually be needed.
(irth o8 IPv* !he I$!# began looking at the problem of expanding the IP address space in 7HH7. *ince the IP address is carried in the header of every IP packet, increasing the si e of the address dictates a change in the packet header. !he effort to define a new version of IP was known as IP %ext Keneration, or IPng. IPng is now known as IPvD. !he apparent discontinuity in numbering is the result of version number - being used for an experimental protocol some years ago. IPvD was designed for various reasons such as o support for real"time services o security support o autoconfiguration
C.S.ANITA ASSOC.PROF/CSE RMDEC
51
o enhanced routing functionality &eatures o8 IPv* IPvD provides a 7,C"bit address space, as opposed to the 6, bits of version A. Address %pace A""ocation o IPvD addresses do not have classes, but the address space is still subdivided in various ways based on the leading bits. o .ather than specifying different address classes,the leading bits specify different uses of the IPvD address. !he current assignment of prefixes is listed in !able 6.7,.
52
Ta'"e ,.-1 Adress pre8i@ assign#ents 8or IPv* Address Notation o Tust as with IPvA, there is some special notation for writing down IPvD addresses. o !he standard representation is x&x&x&x&x&x&x&x,where each 9x: is a hexadecimal representation of a 7D"bit piece of the address. o 'n example would be AI)/&7,6A&AA,,&')4,&BB,,&7,6A&'A-D&B7,A o Packet &or#at o !his one starts with a (ersion field, which is set to D for IPvD.
C.S.ANITA ASSOC.PROF/CSE RMDEC
53
o !he 0ersion 8ie"d is in the same place relative to the start of the header as IPvAGs (ersion field so that header"processing software can immediately decide which header format to look for. o !he Tra88icC"ass and &"ow?a'e" fields both relate to quality of service issues. o !he Pa+"oad?en 8ie"d gives the length of the packet, excluding the IPvD header, measured in bytes. o !he Ne@tHeader 8ie"d cleverly replaces both the IP options and the Protoco" 8ie"d of IPvA. o If options are required, then they are carried in one or more special headers following the IP header, and this is indicated by the value of the %extEeader field. o If there are no special headers, the %extEeader field is the de#u@ ke+ identifying the higher"level protocol running over IP (e.g., !)P or ;/P) o !he Eop1imit field is simply the !!1 of IPvA, renamed to reflect the way it is actually used. o !he bulk of the header is taken up with the source and destination addresses, each of which is 7D bytes (7,C bits) long. !hus, the IPvD header is always AB bytes long.
54
3.13
u"ticasting !he motivation for developing multicast is that there are applications that want to send a packet to more than one destination host. Instead of forcing the source host to send a separate packet to each of the destination hosts, we want the source to be able to send a single packet to a multicast address, and for the network?or internet, in this case?to deliver a copy of that packet to each of a group of hosts. Eosts can then choose to >oin or leave this group at will, without synchroni ing or negotiating with other members of the group. 'lso, a host may belong to more than one group at a time.
%ervice #ode" 8or IP #u"ticast. IP multicast uses the idea of a multicast group that receivers may >oin. $ach group has a specially assigned address, and senders to the group use that address as the destination address for their packets. In IPvA, these addresses are assigned in the class / address space. IPvD also has a portion of its address space reserved for multicast group addresses. Eosts >oin multicast groups using a protocol called Internet )roup anage#ent Protoco" <I) P=. !hey use this to notify a router on their local network of their desire to receive packets sent to a certain multicast group. Protoco" Independent u"ticast <PI =
PI0 was developed in response to the scaling problems of existing multicast routing protocols. It was recogni ed that the existing protocols did not scale well in environments where a relatively small proportion of routers want to receive traffic for a certain group. In PI sparse #ode <PI 9% =, routers explicitly >oin and leave the multicastgroup using PI protoco" #essages known as Moin and Prune #essages.
0ultiprotocol 1abel *witching (0P1*), tries to combine some of the properties of virtual circuits with the flexibility and robustness of datagrams. 4n the one hand, 0P1* is very much associated with the Internet ProtocolGs datagram" based architecture?it relies on IP addresses and IP routing protocols to do its >ob. 4n the other hand, 0P1*"enabled routers also forward packets by examining relatively short, fixed"length labels, and these labels have local scope, >ust like in a virtual circuit network.
56