78
Architecture of Router Find a compromise: 1 < Speedup << N - to get the performance of an OQ switch - close to the cost of an IQ switch Essential for high speed QoS switching

ACN 2013-2014 (2)

Embed Size (px)

Citation preview

Architecture of Router

Find a compromise: 1 < Speedup << N- to get the performance of an OQ switch- close to the cost of an IQ switch

Essential for high speed QoS switching

Packet Switch using General Purpose CPU and NIC

CPU

NIC NIC NIC NIC

high-speed system bus

Packet Processing Functions

Address Lookup and Packet Forwarding

Address Lookup and Packet Forwarding Contd.

Address Lookup and Packet Forwarding Contd.

Route Lookup

Problem No. 3

The figure below shows a data structure for IP address lookup using a trie. In the figure,the nodes containing numbers correspond to valid address prefixes and the numbers are theoutput ports that should be used by packets for which a given prefix is the best match. If apacket with destination address a3b2ff75 is received, what output port should it beforwarded on (the address is given in hexadecimal notation)?

Next-hop Routing

Network-Specific Routing

Host-Specific Routing

Default routing

Block diagram of a Complete Router showing the Interfaces Interfaces to the network

More advanced routers may separate "forwarding" (the tasks ofmoving packets from one interface to another) from "routing" (thetask of determining the best path through the network) and includea number of processors capable of performing these tasks.

Router Network Interface Card

It then uses a local Forwarding Table (known as the "ForwardingInformation Base (FIB)") to identify where in the network thepacket should be routed to (i.e. which output interface should beused).

Forwarding a received packet to an output interface via the packet switch.

Fragmentation and Reassembly

IP Datagram Format

IP Datagram Fields

IP Datagram Header Format

Maximum Transfer Unit

IP Datagram Flag Bits

Important Points are of Fragmentation§ Each fragment is a datagram that begins with a datagram

header§ Header fields in a fragment are derived from the original

datagram§ In a fragment, the following fields differ from the original

datagram• Total Length• Flags• Fragment Offset• Header Checksum

The size of the fragment is determined by the MTU of the outgoingnetwork.

The FLAGS and Fragment Offset field together identify a datagramas a fragment; if both contain zero the datagram is not a fragment.

IP Fragmentation Algorithm

IP Fragmentation Algorithm Contd.

Ø Identification is selected by sender host,and is unique for each packet sent by thathost in recent past.

Ø M bit: shows whether there are morefragments for that packet following

Ø Offset: deals with possibly reorderedfragments (counts 8-byte words; why notcount bytes?)

Ø A packet can be fragmented at multiplerouters

Ø Reassembly is only performed at thereceiving host

Ø When should receiver give up on thereassembly of a packet?

Ident = x Offset = 0

Start of header

0

Rest of header

1400 data bytes

(a)

Ident = x Offset = 0

Start of header

1

Rest of header

512 data bytes

(b)

Ident = x Offset = 64

Start of header

1

Rest of header

512 data bytes

Ident = x Offset = 128

Start of header

0

Rest of header

376 data bytes

IP Datagram Fragmentation

IP Fragmentation Example

Problem No. 1

Solution to Problem No. 1

Problem No. 2

Suppose that host A is connected to a router R1, R1 is connected toanother router R2 and R2 is connected to host B. Suppose that a TCPmessage that contains 900 bytes of data and 20 bytes of TCP header ispassed to the IP code at host A for delivery to B. Show the TotalLength, Identification, DF, MF and Fragment Offset fields of the IPheader in each packet transmitted over the three links. Assume thatlink A-R1 can support a maximum frame size of 1024 bytes including14 byte frame header, link R1-R2 can support a maximum frame sizeof 512 bytes including an 8 byte frame header and link R2-B cansupport a maximum frame size of 512 bytes including a 12 byte frameheader.

Solution to Problem No. 2

Link A-R1Length =940, ID=x, DF=0, MF=0, Offset=0

Link R1-R2Length=500, ID=x, DF=0, MF=1, Offset=0Length=460, ID=x, DF=0, MF=0, Offset=0

Link R2-BLength=500, ID=x, DF=0, MF=0, Offset=0Length=460, ID=x, DF=0, MF=0, Offset=0

Fragmenting a Fragment

IP Reassembly

IP Reassembly Algorithm

IP Reassembly Data Structure

Problem No. 3

Solution to Problem No. 3

Problem No. 3

Look at the 40byte dump of an IP packet containing a TCP segmentbelow.

4500 0028 7a5e 4000 6c06 cc68 180a f0309b62 246c 0991 0016 505a 8239 a61c e5705010 faf0 8512 0000

Identify all the fields of the IP and TCP header. What would the abovepacket look like, if the source and destination ports are swapped? Willthe checksum field change?

IP Datagram Header FormatLook at the 40byte dump of an IPpacket containing a TCP segmentbelow.

4500 0028 7a5e 40004501 6c06 cc68 180a4502 f030 9b62 246c4503 0991 0016 505a4504 8239 a61c e5704505 5010 faf0 85124506 0000

Identify all the fields of the IP andTCP header. What would the abovepacket look like, if the source anddestination ports are swapped? Willthe checksum field change?

Error Detection and Correction

Frame and Protocol Demultiplexing

Packet Classification

Software Implementation of Classificaiton

Example of Optimizing Software Classification

Example of Optimizing Software Classification Contd.

Hardware Implementation of Classification

Illustration of Hardware Classifier

Example of Multi Category Classification

Rule Sets

Software Implementation of Multiple Rules

Example of Variable Size Header : IP Options

Effect of Protocol Design on Classification

Hybrid Classification

Two Basic Types of Classification

Example of Static Classification

Example of Dynamic Classification

Implementation of Dynamic Classification

Flow Identificaiton

Relationship of Classification and Forwarding

Forwarding In a Connectionless Network

Packet Classification Contd.Packet Classification to refer to the process of mapping a packet toone of a finite set of flows or categories.

• A frame containing an IP packet datagram that carries a TCPsegment

• A frame containing an IP datagram that carries a UDP datagram• A frame containing an IP datagram that carries an ICMP message• A frame that contains something other than the above.

The set of four flows is static because the set never changes andcan be defined before any packet arrive. As an alternative, it is toassign flows dynamically. For example, a classifier system can usethe IP source address in a packet to determine the flow, with allpackets from a given IP source address assigned to the same flow.

Demultiplexing Versus ClassificationClassification differs from demultiplexing in several ways.

§ Demultiplexing is always stateless operation in the sense thatthe set of possible choice is fixed and the choice for a givenpacket depends only on the content of that packet.

§ Demultiplexing uses a global type system. That is, both thesender and receiver must participate and agree on theinterpretation of values – the sender store a value in a type filedand the receiver consults the value to determine packetdisposition.

§ Demultiplexing operates one layer at a time.

Demultiplexing Versus Classification Contd.Unlike demultiplexing, a classification system is not guaranteed tobe stateless. The classification is said to be stateless if the systemdetermines the flow for a packet from the packet content alone andit is said to be stateful if the system derives information from thepacket that arrive, and uses both the state information and thecontents of the packet when assigning the packet to a flow.

Stateful classification systems have the property that reordering thesequence of packets can results in changes to flows(i.e., theclassification of a packet depends on the history of previouspacket)

Demultiplexing Versus Classification Contd.Unlike demultiplexing stateful classification sytem does not needto use a global type system and it does require the sender toparticipate. As we saw in the source address example above,

Queueing and Packet Discard

Queueing Priorities

Examples of Queueing Disciplines

Examples of Queueing Disciplines Contd.

Examples of Queueing Disciplines Contd.

Scheduling and Timing

Security and Privacy

Traffic Management and Policing

Traffic Shaping

Examples of Traffic Shaping Mechanism

Examples of Traffic Shaping Mechanism Cond.

Illustration of Traffic Shaper

Timer Management