You are on page 1of 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

Packet Switch using General Purpose CPU and NIC

CPU

high-speed system bus

NIC

NIC

NIC

NIC

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 the output ports that should be used by packets for which a given prefix is the best match. If a packet with destination address a3b2ff75 is received, what output port should it be forwarded 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 of moving packets from one interface to another) from "routing" (the task of determining the best path through the network) and include a number of processors capable of performing these tasks.

Router Network Interface Card

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

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 outgoing network. The FLAGS and Fragment Offset field together identify a datagram as a fragment; if both contain zero the datagram is not a fragment.

IP Fragmentation Algorithm

IP Fragmentation Algorithm Contd.

IP Datagram Fragmentation

(a) Identification is selected by sender host, and is unique for each packet sent by that host in recent past. Ident = x

Start of header 0 Rest of header 1400 data bytes Offset = 0

M bit: shows whether there are more fragments for that packet following (b) Offset: deals with possibly reordered fragments (counts 8-byte words; why not count bytes?)

Start of header Ident = x 1 Rest of header 512 data bytes Offset = 0

Start of header Ident = x 1 Rest of header Offset = 64

A packet can be fragmented at multiple routers Reassembly is only performed at the receiving host When should receiver give up on the reassembly of a packet?
Ident = x

512 data bytes

Start of header

0 Offset = 128 Rest of header 376 data bytes

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 to another router R2 and R2 is connected to host B. Suppose that a TCP message that contains 900 bytes of data and 20 bytes of TCP header is passed to the IP code at host A for delivery to B. Show the Total Length, Identification, DF, MF and Fragment Offset fields of the IP header in each packet transmitted over the three links. Assume that link A-R1 can support a maximum frame size of 1024 bytes including 14 byte frame header, link R1-R2 can support a maximum frame size of 512 bytes including an 8 byte frame header and link R2-B can support a maximum frame size of 512 bytes including a 12 byte frame header.

Solution to Problem No. 2


Link A-R1 Length =940, ID=x, DF=0, MF=0, Offset=0 Link R1-R2 Length=500, ID=x, DF=0, MF=1, Offset=0 Length=460, ID=x, DF=0, MF=0, Offset=0 Link R2-B Length=500, ID=x, DF=0, Length=460, ID=x, DF=0, MF=0, Offset=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 segment below. 4500 9b62 5010 0028 246c faf0 7a5e 0991 8512 4000 0016 0000 6c06 505a cc68 8239 180a a61c f030 e570

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

IP Datagram Header Format


Look at the 40byte dump of an IP packet containing a TCP segment below. 4500 4501 4502 4503 4504 4505 4506 0028 6c06 f030 0991 8239 5010 0000 7a5e cc68 9b62 0016 a61c faf0 4000 180a 246c 505a e570 8512

Identify all the fields of the IP and TCP header. What would the above packet look like, if the source and destination ports are swapped? Will the 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 to one of a finite set of flows or categories. A frame containing an IP packet datagram that carries a TCP segment 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 and can be defined before any packet arrive. As an alternative, it is to assign flows dynamically. For example, a classifier system can use the IP source address in a packet to determine the flow, with all packets from a given IP source address assigned to the same flow.

Demultiplexing Versus Classification


Classification differs from demultiplexing in several ways. Demultiplexing is always stateless operation in the sense that the set of possible choice is fixed and the choice for a given packet depends only on the content of that packet. Demultiplexing uses a global type system. That is, both the sender and receiver must participate and agree on the interpretation of values the sender store a value in a type filed and the receiver consults the value to determine packet disposition. Demultiplexing operates one layer at a time.

Demultiplexing Versus Classification Contd.


Unlike demultiplexing, a classification system is not guaranteed to be stateless. The classification is said to be stateless if the system determines the flow for a packet from the packet content alone and it is said to be stateful if the system derives information from the packet that arrive, and uses both the state information and the contents of the packet when assigning the packet to a flow. Stateful classification systems have the property that reordering the sequence of packets can results in changes to flows(i.e., the classification of a packet depends on the history of previous packet)

Demultiplexing Versus Classification Contd.


Unlike demultiplexing stateful classification sytem does not need to use a global type system and it does require the sender to participate. 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

You might also like