You are on page 1of 17

Packet Flow

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

• Non-time critical tasks - performed on packets destined to a router for maintenance,


management, and error handling.
• Such tasks include, but are not limited to the following:
 Processing of data packets that lead to errors in the fast path and generation of ICMP packets
 Processing of routing protocol keep-alive messages from adjacent neighbors and sending
these messages to the neighboring routers
 Processing of incoming packets that carry route table updates and sending messages to
neighboring routers when network topology changes
 Processing of packets pertaining to management protocols, such as SNMP, and the
associated replies
 These slow path tasks are integrated so that they do not interfere with the fast path
mechanism-time critical operations must have the highest priority
PACKET PROCESSING: FAST PATH VERSUS SLOW PATH

there is no interference with the performance of packets on the fast path.


FAST PATH FUNCTIONS
• the packets are processed and transferred from the ingress line card to the egress line card
through the backplane
• To achieve high speeds, the fast path functions are implemented in custom hardware
• IP Header Processing
• As soon as an IP packet enters a router, it is subjected to a set of validity checks to ensure
that the packet is properly formed and the header is meaningful.
• Only well-formed packets can be further processed, otherwise the packet is discarded.
• verification of the protocol version
• check whether the length of the packet reported by the MAC or the link layer is at least
the minimum legal length of an IP packet
• Checksum - decrement the time-to-live field in the IP header- check whether the TTL
value is positive, zero or negative.
FAST PATH FUNCTIONS
• Packet Forwarding
– determine on which network interface a packet needs to be transmitted out of
the router.
– The forwarding engine module controls this function using a forwarding table.
– The forwarding table is a summary of the routing table created by the route
control processor.
– The router extracts the destination IP address from an incoming packet and
performs a lookup in the forwarding table to determine the next hop IP address
for the packet.
– This procedure also decides which output port and network interface should be
used to send the packet.
FAST PATH FUNCTIONS
• Packet Forwarding
• three possibilities:
– Local
– Unicast
– Multicast
FAST PATH FUNCTIONS
• Packet Forwarding
• three possibilities:
– Local
– Unicast
– Multicast

You might also like