On the rad again The netwrk layer data plane CS242 Cmputer Netwrks The netwrk layer The transprt layer is respnsible fr applicatin t applicatin transprt. The netwrk layer is respnsible fr hst t hst transprt. Unlike the transprt and applicatins layers, there is a piece f the netwrk layer in each hst and ruter in the netwrk. Department f Cmputer Science Wellesley Cllege Netwrk layer 13-2 Data and cntrl planes Ruter frwarding tables The netwrk layer can be decmpsed int tw interacting parts. The data plane cntrls cntrls hw a datagram arriving at a ruter is frwarded. The cntrl plane cntrls hw a datagram is ruted amng ruters alng an end-t-ne path frm surce t destinatin. A ruter frwards a packet by examining the the arriving packet s header field t index int its frwarding table. The result indicates t which f the ruter s link interface the packet is t be sent.* *All well and gd, but where did the frwarding table cme frm in the first place. Netwrk layer 15-3 Netwrk layer 13-4 1
Traditinally, Sftware-defined netwrking (SDN) a ruting algrithm is run in every ruter. The ruting algrithm in ne ruter cmmunicate with thse in ther ruters using a ruting prtcal.* Well, at least until recently. Sftware running in a separate remte cntrller cmputes and distributes frwarding tables t each ruter. The data-plane cmpnents are unchanged, but the cntrl-plane functinally is physically separated frm the ruter. *Mre n this next time. *Mre n this next time as well. Netwrk layer 13-5 Netwrk layer 13-6 Netwrk service mdels Service mdels t chse frm The netwrk service mdel defines the characteristics f the end-t-end transprt f data. Guaranteed delivery? Guaranteed delivery with bunded delay? In-rder packet delivery? Minimal bandwidth? Maximum jitter*? Security? Netwrk Architecture Internet ATM ATM Service Mdel best effrt* nne CBR** ABR*** Bandwidth cnstant rate minimum Guarantees? Lss n yes n Order n yes yes Timing n yes n Cngestin feedback n (inferred via lss) n cngestin yes *Best-effrt service appears t be a euphemism fr n service at all. **Cnstant Bit Rate gal is t lk like a dedicated cpper r fiber cnnectin. ***Available Bit Rate best characterized as slightly-better-than-best-effrt. Netwrk layer 13-7 Netwrk layer 13-8 2
What s inside a ruter? Ruter architecture Ruting, management cntrl plane (sftware) Frwarding data plane (hardware) Ruting prcessr At physical layer terminates incming link At link layer it des prtcl decapsulatin & at the netwrk layer it des frwarding Cnnects inputs t prper utputs *Tday we fcus mstly n the data plane. We ll start the cntrl plane next time. Netwrk layer 13-9 Reverse functins f input prt Netwrk layer 13-10 Traditinally: Rle f the ruter s lcal prcessr SDN: Rle f ruter s lcal prcessr At physical layer terminates incming link At link layer it des prtcl decapsulatin & at the netwrk layer it des frwarding Cnnects inputs t prper utputs At physical layer terminates incming link At link layer it des prtcl decapsulatin & at the netwrk layer it des frwarding Cnnects inputs t prper utputs Executed ruting prtcls t maintain frwarding tables Reverse functins f input prt Netwrk layer 13-11 Cmmunicates with remte cntrller t receive and install frwarding table entries. Perfrms netwrk management functins Reverse functins f input prt Netwrk layer 13-12 3
Data plane: Hardware implementatin Input prts lkup & frwarding A ruter s input prts, utput prts, and switching fabric are almst always implemented in hardware The frwarding table is either cmputed and updated by the ruting prcessr r is received frm a remte SDN cntrller, then cpied t the line cards. With shadw cpies at each line card, the input prt simply des a linear search f the table fr the lngest netwrk prefix match. While the ruter s cntrl functins are typically implemented in sftware Netwrk layer 13-13 Netwrk layer 13-14 Life shuld be s simple Nt nly that, but but ruting tables must be humngus The prblem is that the input prt shuld be able t prceed at line speed. Fr a 10 Gbps link with packets 64 bytes lng, the input prt has nly 51.ns t prcess a the datagram At ne entry per pssible destinatin each ruter wuld have billins and billins f entries. Table lkup and maintenance wuld mre than a challenge. Frtunately, the Internet has a better way. Netwrk layer 13-15 Netwrk layer 13-16 4
Organize addressing int ranges Then, match the lngest prefix Destinatin Address Range Link Interface Lngest prefix match: 11001000 00010111 00010000 00000000 thrugh 0 11001000 00010111 00010111 11111111 11001000 00010111 00011000 00000000 thrugh 1 11001000 00010111 00011000 11111111 11001000 00010111 00011001 00000000 thrugh 2 11001000 00010111 00011111 11111111 therwise 3 Prefix match Link 11001000 00010111 00010 0 11001000 00010111 00011000 1 11001000 00010111 00011 2 therwise 3 Fr either technique t wrk, Internet addresses need t be assigned in cntiguus blcks. Fragmentatin rears its ugly head.* *The self same fragmentatin that slws perating systems and hard drives. Netwrk layer 13-17 Netwrk layer 13-18 Typically, Hwever it is dne,... Ternary cntent addressable memries (TCAMs) are used fr lkup. A 32-bit IP address is presented t memry, which returns the cntent f the frwarding table entry fr that address in essentially cnstant time.... we will prbably need wait in line t get ur barding pass. The Cisc 6500 and 7600 series ruters can hld upwards f a millin TCAM frwarding table entries. Netwrk layer 13-19 Netwrk layer 13-20 5
We have ur ticket, nw t find the gate Switching in memry* Okay, we've made thrugh the input queue. Hw d we find ur way t the crrect utput prt? The simplest methd is t put switching between input and utput prts under the direct cntrl f the ruting prcessr. The arriving packet is cpied frm the input queue int memry Hw we get there is the jb f the switching fabric. Many mdern cmputers d just that, but the prcessrs are lcated in the input cards. This lks a lt like shared memry multiprcessing. The ruting prcessr extracts the destinatin address, lks up the prt and cpies the packet t the utput prt's buffer *Input and utput prts functin as traditinal I/O devices in the usual OS. Netwrk layer 13-21 Netwrk layer 13-22 Switching via a bus With bus bandwidths ver a gigabit per secnd, switching via a bus is ften sufficient fr ruters that perate in access and enterprise netwrks. But, bus bandwidth is a rate limiter. Since the bus is shared, nly ne packet can be transferred at a time. Switching via an intercnnectin netwrk* A mre sphisticated intercnnectin netwrk may vercme the bandwidth limitatin f a single, shared bus. Netwrk layer 13-23 *Similar t the technique used in the past t intercnnect prcessrs in a multiprcessr cmputer architecture. Netwrk layer 13-24 6
Finally thrugh the switching netwrk we reach the utput prt Output prt prvides data link prtcl prcessing and line terminatin that interacts with the input prt n the ther end f the utging line. Output prt prblems We assume that all input and utput line speeds are identical and that there are n input prts and n utput prts. But the real stry is in the queuing buffer required when switch fabric bests the utput link rate. If the switching fabric speed is at least n time as fast as the input line speed, then n queuing can ccur at the input prts But what happens at the utput prts? Netwrk layer 13-25 Netwrk layer 13-26 A line frms at the utput prt Waiting in line t get in line At the utput queue a packet scheduler must chse ne packet amng thse queued fr transmissin. May be FIFO r a sme frm f weighted fair queuing. If the switch fabric is nt fast enugh t transfer all packets thrugh the fabric withut delay, then packet queuing will als ccur at the input prts. An input queue can grw t unbunded length under certain assumptins as sn as the packet arrival rate reaches nly 58% due t smething called Head-Ofthe_Line (HOL) blcking. Netwrk layer 13-27 Netwrk layer 13-28 7
HOL blcking at an input queued switch Active queue management If there is nt enugh buffer, a decisin must be made t either drp the arriving packet (drp-tail) r remve ne r mre f the already-queued packets. It may be advantageus t drp a packet befre the buffer is full in rder t prvide a cngestin signal t the sender. Netwrk layer 13-29 Netwrk layer 13-30 Randm Early Detectin (RED) Packet scheduling: First In First Out A weighted average is maintained fr the length f the utput queue. If the average is less than min th, the packet is enqueued. If the the queue is full r the average is greater than max th, the packet is drpped. If average is in [min th, max th ] it is drpped with prbability that is a functin f the average queue length. Affectinately knwn as FIFO, this ne is an ld friend. If there is nt sufficient buffering space t hld arriving packets, the queue s packet-discard plicy kits in. Assuming sufficient space, packets jin the back f the queue, remain in rder, and are served when they reach the frnt. Netwrk layer 13-31 Netwrk layer 13-32 8
FIFO in actin Packet scheduling: Pririty queues Packets arriving at the utput queue are classified int pririty classes. Each pririty class has its wn, usually FIFO, queue. The link chses a packet frm the highest nnempty queue. Netwrk layer 13-33 Netwrk layer 13-34 Pririty queues in actin Wrk-cnserving rund rbin queues Netwrk layer 13-35 Netwrk layer 13-36 9
Weighted fair queuing (WFQ) Next time: The Internet Prtcl Similar t a wrkcnserving queuing rund rbin discipline. Arriving packets are classified and queued int per-class waiting areas and served in a rund rbin fashin. IP used a variatin f ne way during during its first s many years and then had a change f heart in 1993. We'll see why (and hw) in ur next class. Unlike rund rbin, each class may receive a differential amunt f service in any interval f time. Netwrk layer 13-37 Netwrk layer 13-38 10