0% found this document useful (0 votes)
77 views16 pages

Internet Protocols: Layering & Design Principles

The document discusses protocol design concepts and the Internet protocol stack. It introduces the concepts of layering and modularity in protocol design, and describes how protocols are organized into layers with service interfaces between layers and peer-to-peer interfaces across nodes. It then discusses the TCP/IP model and how the layers map to functions like physical transmission, data linking, networking, transporting, and application functions. A key principle is the "end-to-end principle" where functions are placed at the endpoints rather than in the network when possible to keep the network simple while making the endpoints intelligent and in control. The implications and tradeoffs of this principle are discussed in the context of functions like reliability, congestion control, and economic concerns

Uploaded by

Aamir Khan
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
77 views16 pages

Internet Protocols: Layering & Design Principles

The document discusses protocol design concepts and the Internet protocol stack. It introduces the concepts of layering and modularity in protocol design, and describes how protocols are organized into layers with service interfaces between layers and peer-to-peer interfaces across nodes. It then discusses the TCP/IP model and how the layers map to functions like physical transmission, data linking, networking, transporting, and application functions. A key principle is the "end-to-end principle" where functions are placed at the endpoints rather than in the network when possible to keep the network simple while making the endpoints intelligent and in control. The implications and tradeoffs of this principle are discussed in the context of functions like reliability, congestion control, and economic concerns

Uploaded by

Aamir Khan
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd

Protocol Design Concepts, IP and Routing

Section 1: Introduction A central idea in the design of protocols is that of layering; and a guiding principle of Internet protocols is the end-to-end principle. In this chapter, we review these ideas and describe the transport and network layers in the Internet stack. 1.1 Protocols and Layering Protocols are co ple!, distributed pieces of software. Abstraction and odular design are standard techni"ues used by software engineers to deal with co ple!ity. #y abstraction, we ean that a subset of functions is carefully chosen and setup as a blackbo! or odule $see %igure &'. (he odule has an interface describing its input)output behavior. (he interface outlives the i ple entation the odule in the sense that the technology used to i ple ent the interface ay change often, but the interface tends to re ain constant. *odules ay be built and aintained by different entities. (he software odules are then used as building blocks in a larger design. Place ent of functions to design the right building blocks and interfaces is a core activity in software engineering.

Input Interface

,oftware *odule

+utput Interface

Figure 1: Abstraction of Functionality into

odules

Protocols have an additional constraint of being distributed. (herefore software odules have to co unicate with one or ore software odules at a distance. ,uch interfaces across a distance are ter ed as peer-to-peer interfaces; and the local interfaces are ter ed as service interfaces $%igure -'. ,ince protocol function naturally tend to be a se"uence of functions, the odules on each end are organi.ed as a $vertical' se"uence called layers. (he set of odules organi.ed as layers is also co only called a protocol stack. (he concept of layering is illustrated in %igure /. Service Interface Input +utput ,oftware *odule Figure !: Co""unicating Soft#are Peer-to-Peer Interface ,oftware *odule odules Service Interface +utput Input

Service Interfaces Peer-to-Peer Interface

2ayer i+1

2ayer i+1

Service Interfaces Peer-to-Peer Interface

2ayer i

2ayer i

Figure $: Layered Co""unicating Soft#are

odules %Protocols&

+ver the years, so e layered odels have been standardi.ed. (he I,+ +pen ,yste s Interconnection $I,+)+,I' layered odel has seven layers and was developed by a set of co ittees under the auspices of International ,tandards +rgani.ation $I,+'. (he (0P)IP has a 1-layered stack that has beco e a de facto standard of the Internet. (he (0P)IP and I,+)+,I stacks and their rough correspondences are illustrated in %igure 1. (he particular protocols of the (0P)IP stack are also shown. Application Presentation ,ession (ransport 3etwork Point-toPoint 4atalink Physical

Application

%(P

(elnet

5((P

(ransport Internetwork 5ost to 3etwork

(0P IP 6ther net Packet 8adio

74P

Figure ': (CP)IP *s IS+)+SI Protocol Stac, (he physical layer deals with getting viable bit-trans ission out of the underlying ediu $fiber, copper, coa! cable, air etc'. (he data-link layer then converts this bit-

trans ission into a fra ed-trans ission on the link. %ra es are used to allow ultiple!ing of several strea s; and defines the unit of trans ission used in error detection and flow control. In the event that the link is actually shared $i.e. ultiple access', the data link layer defines the ediu access control $*A0' protocol as well. (he network layer deals with packet trans ission across ultiple links fro the source node to the destination node. (he functions here include routing, signaling and echanis s to deal with the heterogeneous link layers at each link. (he transport layer protocol provides end-to-end co unication services, i.e., it allows applications to ultiple! the network service, and ay add other capabilities like connection setup, reliability and flow)congestion control. 6!a ples of co unication abstractions provided by the transport layer include a reliable byte-strea service $(0P' and an unreliable datagra service $74P'. (hese abstractions are ade available through application-level progra ing interfaces $APIs' such as the #,4 socket interface. (he application layers $session, presentation, application' then use the co unication abstractions provided by the transport layer to create the basis for interesting applications like e ail, web, file transfer, ulti edia conference, peer-to-peer applications etc. 6!a ples of such protocols include ,*(P, 5((P, 43,, 5./-/ and ,IP. 1.! (-e .nd/to/.nd Principle in Internet Protocol Design A key principle used in the design of the (0P)IP protocols is the so-called end-to-end principle that guides the place ent of functionality in a co ple! distributed syste . (he principle suggests that 9functions placed at the lower levels may be redundant or of little value when compared to the cost of providing them at the lower level In other words, a syste $or subsyste level' should consider only functions that can be completely and correctly i ple ented within it. All other functions are best oved to the syste level where it can be co pletely and correctly i ple ented. In the conte!t of the Internet, it i plies that several functions like reliability, congestion control, session)connection anage ent are best oved to the end-syste s $i.e. perfor ed on an end-to-end basis', and the network layer focuses on functions which it can fully i ple ent, i.e. routing and datagra delivery. As a result, the end-syste s are intelligent and in control of the co unication while the forwarding aspects of the network is kept si ple. (his leads to a philosophy dia etrically opposite to the telephone world which sports du b end-syste s $the telephone' and intelligent networks. Indeed the isunderstanding of the end-to-end principle has been a pri ary cause for friction between the telephony and internet ca ps. Arguably the telephone world developed as such due to technological and econo ic reasons because intelligent and affordable end-syste s were not possible until &:;<s. Also, as an aside, note that there is a isconception that the end-to-end principle i plies a du b network. 8outing is a good e!a ple of a very co ple! function that is consistent with the end-to-end principle, but is non-trivial in ter s of co ple!ity. 8outing is kept at the network level because it can be co pletely i ple ented at that level, and the costs of involving the end-syste s in routing are for idable.

(he end-to-end principle further argues that even if the network layer did provide connection anage ent and reliability, transport levels would have to add reliability to account for the interaction at the transport-network boundary; or if the transport needs ore reliability than what the network provides. 8e oving these concerns fro the lower layer packet-forwarding devices strea lines the forwarding process, contributing to syste -wide efficiency and lower costs. In other words, the costs of providing the inco plete function at the network layers would arguably outweigh the benefits. It should be noted that the end-to-end principle e phasi.es function place ent vis-a-vis correctness, co pleteness and overall syste costs. (he argu ent does say that, sometimes an incomplete version of the function provided by the communication system may be useful as a performance enhancement In other words, the principle does allow a cost-perfor ance tradeoff, and incorporation of econo ic concerns. 5owever, it cautions that the choice of such inco plete versions of functions to be placed inside the network should be ade very prudently. 2ets try to understand so e i plications of this aspect. +ne issue regarding the inco plete network-level function is the degree of state aintained inside the network. 2ack of state re oves any re"uire ent for the network nodes to notify each other as endpoint connections are for ed or dropped. %urther ore, the endpoints are not, and need not be, aware of any network co ponents other than the destination, first hop router$s', and an optional na e resolution service. Packet integrity is preserved through the network, and transport checksu s and any address-dependent security functions are valid end-to-end. If state is aintained only in the endpoints, in such a way that the state can only be destroyed when the endpoint itself breaks $also ter ed fate-sharing', then as networks grow in si.e, likelihood of co ponent failures affecting a connection beco es increasingly fre"uent. If failures lead to loss of co unication, because key state is lost, then the network beco es increasingly brittle, and its utility degrades. 5owever, if an endpoint itself fails, then there is no hope of subse"uent co unication anyway. (herefore one "uick interpretation of the end-to-end odel is that it suggests that only the endpoints should hold critical state. #ut this is flawed. 2et us consider the econo ic issues of Internet ,ervice Provider $I,Ps' into this i!. I,Ps need to go beyond the co oditised i! of access and connectivity services to provide differentiated network services. Providing =uality of ,ervice $=o,' and charging for it i plies that so e part of the network has to participate in decisions of resource sharing, and billing, which cannot be entrusted to end-syste s. A correct application of the end-to-end principle in this scenario is as follows> due to the econo ic and trust odel issues, these functions belong to the network. Applications ay be allowed to participate in the decision process, but the control belongs to the network, not the endsyste in this atter. (he differentiated services architecture discussed later in this chapter has the notion of the network edge which is the repository of these functions.

In su ary, the end-to-end principle has guided a vast a?ority of function place ent decisions in the Internet and it re ains relevant today even as the design decisions are intertwined with co ple! econo ic concerns of ultiple I,Ps and vendors. Section $: 0et#or, Layer (he network layer in the (0P)IP stack deals with internetworking and routing. (he core proble s of internetworking are heterogeneity and scale. 5eterogeneity is the proble of dealing with disparate layer - networks to create a viable forwarding and addressing paradig ; and the proble of providing eaningful service to a range of disparate applications. ,cale is the proble of allowing the Internet to grow without bounds to eet its intended user de ands. (he Internet design applies the end-to-end principle to deal with these proble s. $.1 0et#or, Ser*ice odels

+ne way of dealing with heterogeneity is to provide translation services between the heterogeneous entities when forwarding across the is desired. 6!a ples of such design include ulti-protocol bridges and ulti-protocol routers. #ut this gets too co plicated and does not allow scaling because every new entity that wishes to ?oin the Internet will re"uire changes in all e!isting infrastructure. A ore preferable re"uire ent is to be able to incrementally upgrade the network. (he alternative strategy is called an overlay odel where a new protocol $IP' with its own packet for at and address space is developed and the apping is done between all protocols and this inter ediate protocol. IP has to be si ple by necessity so that the apping between IP and lower layer protocols is si plified. As a result, IP opts for a best-effort, unreliable datagra service odel where it forwards datagra s between sources and destinations situated on, and separated by a set of disparate networks. IP e!pects a ini al link-level fra e forwarding service fro lower layers. (he apping between IP and lower layers involve address apping issues $eg> address resolution' and packet for at apping issues $eg> frag entation)reasse bly'. 6!perience has shown that this apping is straightforward in any subnetworks, especially those that are not too large, and those which support broadcast at the 2A3 level. (he address resolution can be a co ple! proble on nonbroadcast ultiple access $3#*A' sub-networks; and the control protocols associated with IP $esp #@P routing' can place other re"uire ents on large sub-networks $eg> A(* networks' which ake the apping proble s hard. 5ybrid technologies like *P2, are used to address these apping concerns, and to enable new traffic engineering capabilities in core networks. %or several applications, it turns out that the si ple best-effort service provided by IP can be aug ented with end-to-end transport protocols like (0P, 74P and 8(P to be sufficient. +ther applications having stringent perfor ance e!pectations $eg> telephony' need to either adapt and)or use aug ented =o, capabilities fro the network. Ahile several echanis s and protocols for this have been developed in the last decade, a fully =o,-capable Internet is still a holy grail for the Internet co unity. (he hard proble s

surround routing, inter-do ain) ulti-provider issues, and the i plications of =o, on a range of functions $routing, forwarding, scheduling, signaling, application adaptation etc'. In su ary, the best-effort, overlay odel of IP has proved to be enor ously successful, it has faced proble s in being apped to large 3#*A sub-networks and continues to faces challenges in the inter-do ain) ulti-provider and =o, areas. $.! (-e Internet Protocol %IP&: For#arding Paradig" (he core service provided by IP is datagra forwarding over disparate networks. (his itself is a non-trivial proble . (he end-result of this forwarding service is to provide connectivity. (he two broad approaches to getting connectivity are> direct connectivity and indirect connectivity. Direct connectivity refers to the case where the destination is only a single link away $this includes shared and unshared edia'. Indirect connectivity refers to connectivity achieved by going through inter ediate co ponents or inter ediate networks. (he inter ediate co ponents $bridges, switches, routers, 3A( bo!es etc' are dedicated to functions to deal with the proble of scale and)or heterogeneity. Indeed the function of providing indirect connectivity through inter ediate networks can be thought of as a design of a large virtual inter ediate co ponent, the Internet. (hese different for s of connectivity are shown in %igures B-;.

33. 4us

Full "es-

Figure 1: Direct Connecti*ity Arc-itectures

Star

Figure 2: Indirect Connecti*ity t-oug- Inter"ediate Co"ponents

S Ring Tree

3 Internet

Figure 5: Indirect Connecti*ity t-oug- Inter"ediate 0e#or,s 6 Co"ponents (he proble of scaling with respect to a para eter $eg> nu ber of nodes' is inversely related to the efficiency characteristics of the architecture with respect to the sa e para eter. %or e!a ple, direct connectivity architectures do not scale because of finite capacity of shared ediu , or finite interface slots; or high costs of provisioning a full esh of links. A way to deal with this is to build a switched network, where the inter ediate co ponents $switches' provide filtering and forwarding capabilities to isolate ultiple networks to keep the within their scaling li its, and yet providing scalable interconnection. In general, the ore efficient the filtering and forwarding of these co ponents, the ore scalable is the architecture. 2ayer & hubs do pure broadcast, and hence do no filtering, but can forward signals. 2ayer - bridges and switches can filter to an e!tent using forwarding tables learnt by snooping; but their default to flooding on a spanning tree when the forwarding table does not contain the address of the receiver. (his default behavior of flooding or broadcast is inefficient, and hence li its scalability. (his behavior if also partially a result of the flat addressing structure used by 2- networks. In contrast, layer / $IP' switches $aka routers' never broadcast across sub-networks; and rely on a set of routing protocols and a concatenated set of local forwarding decisions to deliver packets across the Internet. IP addressing is designed hierarchically, and address assign ent is coordinated with routing design. (his enables inter ediate node $or hosts' to do a si ple deter ination> whether the destination is directly or indirectly connected. In the for er case, si ple layer - forwarding is invoked; and in the latter case, a layer / forwarding decision is ade to deter ine the ne!t-hop that is an inter ediate node on the sa e sub-network, and then the layer - forwarding is invoked. 5eterogeneity is supported by IP because it invokes only a ini al forwarding service of the underlying 2- protocol. #efore invoking this 2- forwarding service, the router has to a' deter ine the 2- address of the destination $or ne!t-hop' -- an address resolution proble ; and b' ap the datagra to the underlying 2- fra e for at. If the datagra is too large, it has to do so ething -- frag entation)reasse bly. IP does not e!pect any other special feature in lower layers and hence can work over a range of 2- protocols.

In su ary, the IP forwarding paradig naturally co es out of the notions of direct and indirect connectivity. (he secret sauce is in the way addressing is designed to enable the directly)indirectly reachable "uery; and the scalable design of routing protocols to aid the deter ination of the appropriate ne!t-hop if the destination is indirectly connected. 5eterogeneity leads to apping issues, which are si plified because of the ini alist e!pectations of IP fro its lower layers $only an forwarding capability e!pected'. All other details of lower layers are abstracted out. $.$ (-e Internet Protocol: Pac,et For"at, Addressing, Frag"entation)Reasse"bly $.$.1 IP Pac,et For"at (he IP packet for at is shown in %igure C. (he biggest fields in the header are the source and destination /--bit IP address fields. (he second /--bit line $ID, flags, frag offset' are related to frag entation)reasse bly and will be e!plained later. (he length field indicates the length of the entire datagra , and is re"uired because IP accepts variable length payloads. (he checksum field covers only the header and not the payload and is used to catch any header errors to avoid is-routing garbled packets. 6rror detection in the payload is the responsibility of the transport layer $both 74P and (0P provide error detection'. (he protocol field allows IP to de ultiple! the datagra and deliver it to a higher-level protocol. ,ince it has only C-bits, IP does not support application ultiple!ing. Providing port nu ber fields to enable application ultiple!ing is another re"uired function in transport protocols on IP. (he time-to-live !!"# field is decre ented at every hop and the packet is discarded if the field is <; this prevents packets fro looping forever in the Internet. (he ((2 field is also used a si ple way to scope the reach of the packets, and can be used in con?unction with I0*P, ulticast etc to support ad inistrative functions. (he type-of-service !$S# field was designed to allow optional support for differential forwarding, but has not been e!tensively used. 8ecently, the differentiated services $diff-serv' A@ in I6(% rena ed this field to the DS byte to be used to support diff-serv. (he version field indicates the version of IP and allows e!tensibility. (he current version of IP is version 1. IPvD is the $! bits ne!t generation of IP that ay be deployed over the ne!t decade to support a larger &-Cbit IP address space.-ead. %eader length is a of field used because options can be variable length. type lengt#ut options are rarelylen used in odern IP deploy ents, so we donEt discuss the any *er ser*ice further. frag"ent flgs 12/bit identifier offset ti"e to li*e protocol $! bit source IP address $! bit destination IP address +ptions %if any& data %*ariable lengt-, typically a (CP or 8DP seg"ent& Internet c-ec,su"

Figure 9: IP Pac,et For"at $.$.! IP Addressing and Address Allocation An address is a uni&ue computer-understandable' identifier. 7ni"ueness is defined in a do ain. +utside that do ain one needs to have either a larger address space, or do translation. An address should ideally be valid regardless of the location of the source, but ay change if the destination oves. %i!ed si.e addresses can be processed faster. (he concept of addresses is funda ental to networking. (here is no $non-trivial' network without addresses. Address space si.e also li its the scalability of networks. A large address space allows a large network, i.e. it is funda entally re"uired for network scalability. 2arge address space also akes it easier to assign addresses and ini i.e configuration. In connectionless networks, the ost interesting differences revolve around addresses. After all, a connectionless net basically involves putting an address in a packet and sending it hoping it will get to the destination. IPv1 uses /--bit addresses whereas IPvD uses &-C-bit addresses. %or convenience of writing, a dotted deci al notation beca e popular. 6ach byte is su ari.ed as a base-&< integer, and dots placed between these nu bers $eg> &-C.&&/.1<.B<'. IP addresses have two parts -- a network part $prefi!', and a host part $suffi!'. (his is illustrated in %igure :. 8ecall that the inter ediate nodes $or hosts' have to ake a deter ination whether the destination is directly or indirectly connected. 6!a ining the network part of the IP address allows us to ake this deter ination. If the destination is directly connected, the network part atches the network part of an outgoing interface of the inter ediate node. (his hierarchical structure of addressing which is funda ental to IP scaling is not seen in layer - $I666 C<-' addresses. (he structure has i plications on address allocation because all interfaces on a single sub-network have to be assigned the sa e network part of the address $to enable the forwarding test entioned above'. 3etwork I4 4e arcator 5ost I4

Figure :: ;ierarc-ical Structure of an IP Address 7nfortunately address allocation was not well thought out during the early days of IP, and hence it has followed a nu ber of steps of evolution. Part of the evolution was forced because of the then unforeseen sustained e!ponential growth of the Internet. (he evolution largely centered around the place ent of the conceptual de arcator between the network I4 and 5ost I4 as shown in %igure :. Initially, the addressing followed a classful sche e where the address space was divided into a few blocks and static de arcators assigned to each block. 0lass A has a Cbit de arcator; 0lass # has a &D-bit de arcator; 0lass 0 has a -1-bit de arcator. 0lass 4 was reserved for ulticast and 0lass 6 for future use. (his sche e is shown in %igure &<. (his sche e ran into trouble in early &:C<s because of two reasons> a' class #Es were popular $class 0s largely unallocated' and b' the host space in class As and class #s were largely unused because no single sub-network $eg> 6thernets' was large enough to utili.e the space fully. (he solution to these proble s is si ple -- allow the host space to be further subdivided; and allow de arcators to be placed ore fle!ibly rather than statically. (hese reali.ations led to the develop ent of subnet and supernet asking respectively. A ask is a /--bit pattern, the ones of which indicate the bits belonging to the network I4 and the .eros indicate the host I4 bits. %or si plicity, the ones in the asks are contiguous. %or e!a ple, a subnet ask -BB.-BB.-BB.< applied to IP address &-C.&&/.1<.B< indicates that the network I4 has been e!tended fro &D-bits $since this is a class # address' to -1-bits. ,upernet asks are used between autono ous syste s to indicate address allocations or to advertise networks for routing. %or e!a ple the notation &:C.-C.-:.<)&C indicates an &C-bit address space. (he supernet ask written as )&C is actually -BB.-BB.&:-.<. +bserve that the &:C.-C.-:.< belonged to the class 0 space according to the earlier classful sche e and class 0 ad its only of )-1 networks $i.e. with host space of C bits'. class A B C D 0 network 10 110 1110 network network multicast address #2 %its host host host 1.0.0.0 to 127.2 .2 .2

12!.0.0.0 to 1"1.2 .2 .2 1"2.0.0.0 to 22#.2 .2 .2 22$.0.0.0 to 2#".2 .2 .2

Figure 1<: Initial Classful Addressing for IP*' ,ince these class boundaries are no longer valid with the supernet asks, this allocation sche e is also called classless allocation; and the routing sche e which acco panied this develop ent is called (lassless Inter-Domain )outing' (ID)#* +ne effect of 0I48 and supernet asking is that it is possible for a destination address to atch ultiple prefi!es of different lengths. (o resolve this, 0I48 prescribes that the longestprefi! atch be chosen for the 2/ forwarding decision. As a result, all routers in the id &:C<s had to replace their forwarding algorith s. ,i ilarly when subnet asking was introduced, hosts and routers had to be configured with subnet asks; and had to apply the ask in the forwarding process to deter ine the true network I4. 8ecall that the network I4 is used to deter ine if the destination is directly or indirectly connected. (hese evolutionary changes are e!a ples of how control-plane changes $0I48 and address allocation' could also affect the data-plane $IP forwarding' operation. In odern networks, two other sche es are also used to further conserve public address space> 450P and 3A(. (he 4yna ic 5ost 0onfiguration Protocol $450P' was originally a network booting protocol that configured essential para eters to hosts and routers. 3ow, it is pri arily used to lease a pool of scarce public addresses a ong hosts who need it for connecting to the Internet. +bserve that the leasing odel eans that host interfaces no longer own IP addresses. (he 3etwork Address (ranslator $3A(' syste enables the use of private address spaces within large enterprises. (he Internet Assigned 3u bers Authority $IA3A' has reserved the following three blocks of the IP address space for private internets> &<.<.<.< - &<.-BB.-BB.-BB $&<)C prefi!' &;-.&D.<.< - &;-./&.-BB.-BB $&;-.&D)&- prefi!' &:-.&DC.<.< - &:-.&DC.-BB.-BB $&:-.&DC)&D prefi!' (he 3A( bo!es at the edge of these private networks then translate public addresses to private addresses for all active sessions. ,ince early applications $eg> %(P' overloaded the se antics of IP addresses and included the in application-level fields, 3A( has to transfor these addresses as well. 3A( breaks certain security protocols, notably IP,60, which in part tries to ensure integrity of the IP addresses during trans ission. (he co bination of these techni"ues has delayed the deploy ent of IPvD that proposes a ore long-lived solution to address space shortage. I6(% and the IPvD %oru have been planning the deploy ent of IPvD for over a decade now, and it re ains to be seen what will be the a?or catalyst for IPvD adoption. (he potential growth of /@ wireless networks and)or the strain on inter-do ain routing due to ulti-ho ing have been recently cited as possible catalysts. I,Ps pro?ect that the IPv1 address space can be prolonged for another decade with the above techni"ues. $.$.$ ARP, Frag"entation and Reasse"bly

8ecall that the overlay odel used by IP results in two apping proble s> address apping and packet for at apping. (he address apping is resolved by a sub-IP protocol called A8P, while the packet apping is done within IP by the frag entation)reasse bly procedures. (he apping proble s in IP are far si pler than other internetworking protocols in the early C<s because IP has ini al e!pectations fro the lower layers. (he address apping proble occurs once the destination or ne!t-hop is deter ined at the IP level $i.e. using the 2/ forwarding table'. (he proble is as follows> the node knows the IP address of the ne!t hop $which by definition is directly connected $i.e. accessible through layer - forwarding'. #ut now to be able to use 2- forwarding, it needs to find out the ne!t-hopEs 2- address. ,ince the address spaces of 2- and 2/ are independently assigned, the apping is not a si ple functional relationship, i.e., it has to be discovered dyna ically. (he protocol used to discover the 2/ address to 2- address apping is called the Address 8esolution Protocol $A8P'. (he A8P at the node sends out a link-level broadcast essage re"uesting the apping. ,ince the ne!t hop is on the sa e layer-- wire, it will respond with a unicast A8P reply to the node giving its 2- address. (hen the node uses this 2- address, and encloses the IP datagra in the 2- fra e payload and drops the fra e on the 2- wire. A8P then uses caching $i.e. an A8P apping table' to avoid the broadcast re"uest-response for future packets. In fact, other nodes on the sa e 2- wire also snoop and update their A8P tables, thus reducing the need for redundant A8P broadcasts. ,ince the apping between 2/ and 2- addresses could change $because both 2- and 2/ address can be dyna ically assigned', the A8P table entries are aged and e!punged after a ti eout period. (he packet- apping proble occurs when the IP datagra to be forwarded is larger than the a!i u trans ission unit $*(7' possible in the link layer. 6very link typically has a *(7 for reasons such as fairness in ultiple!ing, error detection efficiency etc. %or e!a ple, 6thernet has an *(7 of &B&C bytes. (he solution is for the IP datagra to be frag ented such that each frag ent fits the 2- payload. 6ach frag ent now beco es an independent IP datagra ; hence the IP header is copied over. 5owever, it also needs to indicate the original datagra , the position $or offset' of the frag ent in the original datagra and whether it is the last datagra . (hese pieces of infor ation are filled into the frag entation fields in the IP header $I4, flags, frag offset' respectively. (he reasse bly is then done at the IP layer in the ulti ate destination. %rag ents ay co e out-of-order or be delayed. A reasse bly table data structure and a ti e-out per datagra is aintained at the receiver to i ple ent this function. 8easse bly is not atte pted at inter ediate routers because all frag ents ay not be routed through the sa e path. In general, though frag entation is a necessary function for correctness, it has severe perfor ance penalties. (his is because any one of the frag ents lost leads to the entire datagra being discarded at the receiver. *oreover, the re aining frag ents that have reached the receiver $and are discarded' have consu ed and effectively wasted scare resources at inter ediate nodes. (herefore, odern transport protocols try to avoid

frag entation as uch as possible by first discovering the ini u *(7 of the path. (his procedure is also known as path-+!, discovery. Periodically $every D seconds or so', an active session will invoke the path-*(7 procedure. (he procedure starts by sending a a!i u si.ed datagra with the do not fragment bit set in the flags field. Ahen a router is forced to consider frag entation due to a s aller *(7 than the datagra , it drops the datagra and sends an I0*P essage indicating the *(7 of the link. (he host then retries the procedure with the new *(7. (his process is repeated till an appropriately si.ed packet reaches the receiver, the si.e of which is used as the a!i u datagra si.e for future trans issions. In su ary, the apping proble s in IP are solved by A8P $a separate protocol' and frag entation)reasse bly procedures. %rag entation avoidance is a perfor ance i perative and is carried out through path *(7 discovery. (his co pletes the discussion of the key data-plane concepts in IP. (he issing pieces now are the routing protocols used to populate forwarding tables such that a concatenation of local decisions $forwarding' leads to efficient global connectivity. $.$ Routing in t-e Internet 8outing is the agic enabling connectivity. It is the control-plane function, which sets up the local forwarding tables at the inter ediate nodes, such that a concatenation of local forwarding decisions leads to global connectivity. (he global connectivity is also efficient in the sense that loops are avoided in the steady state. Internet routing is scalable because it is hierarchical. (here are two categories of routing in the Internet> inter-do ain routing and intra-do ain routing. Inter-do ain routing is perfor ed between autono ous syste s $A,Es'. An autono ous syste defines the locus of single ad inistrative control and is internally connected, i.e., e ploys appropriate routing so that two internal nodes need not use an e!ternal route to reach each other. (he internal connectivity in an A, is achieved through intra-do ain routing protocols. +nce the nodes and links of a network are defined and the boundary of the routing architecture is defined, then the routing protocol is responsible for capturing and condensing the appropriate global state into local state $i.e. the forwarding table'. (wo issues in routing are completeness and consistency. In the steady state, the routing infor ation at nodes ust be consistent, i.e., a series of independent local forwarding decisions ust lead to connectivity between any $source, destination' pair in the network. If this condition is not true, then the routing algorith is said to not have converged to steady state, i.e., it is in a transient state. In certain routing protocols, convergence ay take a long ti e. In general a part of the routing infor ation ay be consistent while the rest ay be inconsistent. If packets are forwarded during the period of convergence, they ay end up in loops or arbitrarily traverse the network without reaching the destination. (his is why the ((2 field in the IP header is used. In general, a faster convergence algorith is preferred, and is considered

ore stable; but this ay co e at the e!pense of co ple!ity. 2onger convergence ti es also li it the scalability of the algorith , because with ore nodes, there are ore routes, and each could have convergence issues independently. (ompleteness eans that every node has sufficient infor ation to be able to co pute all paths in the entire network locally. In general, with ore co plete infor ation, routing algorith s tend to converge faster, because the chances of inconsistency reduce. #ut this eans that ore distributed state ust be collected at each node and processed. (he de and for ore co pleteness also li its the scalability of the algorith . ,ince both consistency and co pleteness pose scalability proble s, large networks have to be structured hierarchically $eg> as areas in +,P%' where each area operates independently and views the other areas as a single border node. $.$.1 Distance =ector and Lin,/State Algorit-"s and Protocols In packet switched networks, the two ain types of routing are link-state and distance vector. Distance vector protocols aintain infor ation on a per-node basis $i.e. a vector of ele ents', where each ele ent of the vector represents a distance or a path to that node. "ink state protocols aintain infor ation on a per-link basis where each ele ent represents a weight or a set of attributes of a link. If a graph is considered as a set of nodes and links, it is easy to see that the link-state approach has co plete infor ation $infor ation about links also i plicitly indicates the nodes which are the end-points of the links' whereas the distance vector approach has inco plete infor ation. (he basic algorith s of the distance vector $#ell an-%ord' and the link-state $4i?kstra' atte pt to find the shortest paths in a graph, in a fully distributed anner, assu ing that distance vector or link-state infor ation can only be e!changed between i ediate neighbors. #oth algorith s rely on a si ple recursive e"uation. Assu e that the shortest distance path fro node i to node ? has distance 4$i,?', and it passes through neighbor k to which the cost fro i is c$i,k', then we have the e"uation> 4$i, ?' F c$i,k' G 4$k,?' $&' In other words, the subset of a shortest path is also the shortest path between the two inter ediate nodes. (he distance vector -ellman-.ord# algorithm evaluates this recursion iteratively by starting with initial distance values> 4$i,i' F < ; 4$i,k' F c$i,k' if k is a neighbor $i.e. k is one-hop away'; and 4$i,k' F I3%I3I(H for all other non-neighbors k. +bserve that the set of values 4$i,I' is a distance vector at node i. (he algorith also aintains a ne!thop value for every destination ?, initiali.ed as> ne!t-hop$i' F i; ne!t-hop$k' F k if k is a neighbor, and ne!t-hop$k' F 73J3+A3 if k is a non-neighbor.

3ote that the ne!t-hop values at the end of every iteration go into the forwarding table used at node i. In every iteration each node i e!changes its distance vectors 4$i,I' with its i ediate neighbors. 3ow each node i has the values used in e"uation $&', i.e. 4$i,?' for any destination and 4$k,?' and c$i,k' for each of its neighbors k. 3ow if c$i,k' G 4$k,?' is s aller than the current value of 4$i,?', then 4$i,?' is replaced with c$i,k' G 4$k,?', as per e"uation $&'. (he ne!t-hop value for destination ? is set now to k. (hus after m iterations, each node knows the shortest path possible to any other node which takes m hops or less. (herefore the algorith converges in +$d' iterations where d is the a!i u dia eter of the network. +bserve that each iteration re"uires infor ation e!change between neighbors. At the end of each iteration, the ne!t-hop values for every destination ? are output into the forwarding table used by IP. (he link state Di/kstra# algorithm pivots around the link cost c$i,k' and the destinations ?, rather than the distance 4$i,?' and the source i in the distance-vector approach. It follows a greedy iterative approach to evaluating $&', but it collects all the link states in the graph before running the 4i?kstra algorith locally. (he 4i?kstra algorith at node i aintains two sets> set 3 that contains nodes to which the shortest paths have been found so far, and set * that contains all other nodes. Initially, the set 3 contains node i only, and the ne!t hop $i' F i. %or all other nodes k a value 4$i,k' is aintained which indicates the current value of the path cost $distance' fro i to k. Also a value p$k' indicates what is the predecessor node to k on the shortest known path fro i $i.e. p$k' is a neighbor of k'. Initially, 4$i,i' F < and p$i' F i; 4$i,k' F c$i,k' and p$k' F i if k is a neighbor of i 4$i,k' F I3%I3I(H and p$k' F 73J3+A3 if k is not a neighbor of i ,et 3 contains node i only, and the ne!t hop $i' F i. ,et * contains all other nodes ?. In each iteration, a new node ? is oved fro set * into the set 3. ,uch a node ? has the ini u distance a ong all current nodes in *, i.e. 4$i,?' F in Kl *L 4$i,l'. If ultiple nodes have the sa e ini u distance, any one of the is chosen as ?. 3ode ? is oved fro set * to set 3, and the ne!t-hop$?' is set to the neighbor of i on the shortest path to ?. 3ow, in addition, the distance values of any neighbor k of ? in set * is reset as> If 4$i,k' M c$?,k' G 4$i,?', then 4$i,k' F c$?,k' G 4$i,?', and p$k' F ?. (his operation called rela0ing the edges of ? is essentially the application of e"uation $&'. (his defines the end of the iteration. +bserve that at the end of iteration p the algorith has effectively e!plored paths, which are p hops or s aller fro node i. At the end of the algorith , the set 3 contains all the nodes, and knows all the ne!t-hop$?' values which are entered into the IP forwarding table. (he set * is e pty upon ter ination. (he algorith re"uires n iterations where n is the nu ber of nodes in the graph. #ut since the 4i?kstra algorith is a local co putation, they are perfor ed uch "uicker than in the distance vector approach. (he co ple!ity in the link-state approach is largely due to the need to wait to get all the link states c$?,k' fro the entire network.

(he protocols corresponding to the distance-vector and link-state approaches for intrado ain routing are 8IP and +,P% respectively. In both these algorith s if a link or node goes down, the link costs or distance values have to be updated. 5ence infor ation needs to be distributed and the algorith s need to be rerun. 8IP is used for fairly s all networks ainly due to a convergence proble called count-to-infinity* (he advantage of 8IP is si plicity $-B lines of codeN'. +,P% is a ore co ple! standard that allows hierarchy and is ore stable than 8IP. (herefore it is used in larger networks $esp enterprise and I,P internal networks'. Another popular link-state protocol co only used in I,P networks is I,-I,, which ca e fro the I,+)+,I world, but was adapted to IP networks.

You might also like