Professional Documents
Culture Documents
Packet Processing
Dr.Shiny Duela J
Associate Professor
PACKET FLOW
• All the hosts in IPv4 environment are assigned unique logical IP addresses.
• When a host wants to send some data to another host on the network, it needs the
physical (MAC) address of the destination host.
• To get the MAC address, the host broadcasts ARP message and asks to give the
MAC address whoever is the owner of destination IP address.
• All the host on that segment receives ARP packet but only the host which has its
IP matching with the one in ARP message, replies with its MAC address.
• Once the sender receives the MAC address of receiving station, data is sent on the
physical media.
Egress and Ingress
• Egress in the world of networking
implies traffic that exits an entity or a
network boundary, while Ingress is
traffic that enters the boundary of a
network.
INGRESS AND EGRESS PACKET PROCESSING
• Ingress and Egress are the terms used in network switch and router.
• Ingress (inbound) processing means, when a packet arrives to the switch
it will determine the egress path(egress port) to which the packet need to
be forwarded.
• This processing involves many things, depending on if the packet is a
bridged packet, routed packet and also depends on the routing policies.
• If the processing is successful, switch/router will forward the packet to
egress port, else it drops the packet.
Packet flow in a router
INGRESS PACKET PROCESSING
• When an IP packet arrives from the network, it first enters the network interface.
• The L2 processing logic in the card removes the L2 header and constructs a packet context- a data
structure-carrying
information between different stages of packet processing
inside the router.
• The L2 processing logic appends to the packet context
– source and destination MAC address.
• packet context sends it to the L3 processing logic.
• The L3 processing logic locates the IP header and checks its validity.
• It extracts the relevant IP header information and stores it in the packet context.
• The header information includes the destination address, source address, protocol type, DSCP bits
(for differentiated services) and if the IP packet is carrying TCP or UDP payload, the destination
and the source ports as well.
Typical fields of a packet context
INGRESS PACKET PROCESSING
• the packet context contains enough information for route lookup and classification of the
packet.
• the entire packet context is sent to the forwarding engine in the line card.
• The forwarding engine searches a table (the forwarding table) to determine the next-hop.
• The next-hop information contains the egress line card and the outgoing port.
• This information is populated in the packet context.
• the L3 processing logic sends the IP packet to be temporarily stored in the buffer memory.
• the packet context is appended with the address of the packet in memory and it is sent to the
backplane interface.
• Note that the priority of the packet is taken into account while transmitting on the backplane:
• higher priority packets need to be scheduled ahead of lower priority packets.
EGRESS PACKET PROCESSING
• the backplane interface on the egress line card receives the packet and stores it
in the line card memory.
• The received packet context is updated with the new address of the memory
location and sent to the queue manager.
• The queue manager examines the packet context to determine the packet
priority
• Next the queue manager inserts the context of the packet in the appropriate
queue.
• the queue manager implements a scheduling algorithm-chooses the next packet
to be transmitted
• the traffic manager
PACKET PROCESSING: FAST PATH VERSUS SLOW PATH
• The tasks performed by a router can be categorized into time critical and non-time
critical operations
• fast path and slow path
• The time critical operations - affect the majority of the packets - need to be highly
optimized - achieve gigabit forwarding rates.
• The time critical tasks - header processing and forwarding.
• The header processing functions : packet validation, packet lifetime control and
checksum calculation
• The forwarding functions : destination address lookup, packet classification for service
differentiation, and packet buffering and scheduling.
• these tasks need to be executed for every packet in real time, a high performance router
implements these fast path functions in hardware.
PACKET PROCESSING: FAST PATH VERSUS SLOW PATH