Network Layer
Network Layer
1. Routing: process to find the shortest path from a router to all other routers. "create and fill the table"
2. Forwarding: move packets from router’s input to appropriate router output. "read the table"
To structuring the network:
1- Data plan: local, per-router function. Determines how datagram arriving on router input port is forwarded to
router output port "Forwarding function"
2- Control plan: network-wide logic. Determines how datagram is routed among routers along end-end path
from source to destination. "Routing function"
Control-plane approaches:
a. Per-router/Traditional routing algorithms: implemented in routers (both forwarding & routing algo's)
Each router 1. Do The control plan (routing)table individualy. & 2. Do The forwarding.
b. Logically centralized / Software-defined networking (SDN): implemented in servers/Controller
SDN/Controller: Do The control plan (routing) and send the table to the router.
Routers just do the data plan.
Destination-based forwarding: forward based only on destination IP address (traditional)
Generalized forwarding: simple packet-handling rules, forward based on any set of header field values/Traffic enging
Pattern: match values in packet header fields, if not matched -> pkt_in to controller. Counters: #bytes and #packets
Actions: drop, forward, modify, matched packet or send matched packet to controller Priority
Destination-based forwarding: special case for SDN forwarding: depend on IP dest like traditional
Firewall: do not forward (block) all datagrams \arrive to TCP port# \ sent by host#
Destination-based layer 2 (switch) forwarding: Mac
Router architecture:
1. Routing processor:
Control plan “routing:
2. Input ports:
a. Line termination: convert bits and bytes to frame.
b. Link layer protocol: convert frame to packet (datagram).
c. Lookup forwarding ”queue”: queuing if forwarding rate into switching fabric < datagrams arrival rate.
Find which output port, using header field values & forwarding table in input port memory.
3. Switching fabric: transfer packet from the input buffer to appropriate output buffer.
links many input ports with many output ports. Consists of small switches, provide straight /cross connections
Switching rate: rate at which packets can be transferred from inputs to outputs - measured as multiples of
input/output line rate.
Types:
a. Memory:
I. Traditional computers with switching under direct control of CPU
II. Pkt copied to system’s memory
III. Speed limited by memory bandwidth (2 bus crossings per datagram)
b. Bus:
I. Datagram from input port memory to output port memry via shared bus (1inst. at a time delay).
II. Speed limited by bus bandwidth
c. Crossbar/interconnection: fastest
I. No bus bandwidth limitations.
II. Multiple connections. NxN --> N connections ; each port receives 1 data only.
III. Example uses crossbar: Banyan networks
IV. Head-of-the-Line (HOL) blocking: queued datagram at front of queue prevents others in the
queue from moving forward
4. Output ports:
a. Lookup forwarding ”queue”: queuing if datagrams arrive from fabric > Terminal line (transmission rate)
b. Link layer protocol: convert packet to frame.
c. Line termination: convert frame to bits and bytes.
Scheduling mechanisms
Scheduling: choose next packet to send on the link.
1. FIFO scheduling: send in order of arrival to queue
Discard policy: if a packet arrives to full queue: who to discard?
- tail drop: drop arriving packet
- priority: drop on priority basis. | Top priority: "sensitive to delay" 1-Audio 2-Multimedia 3-Text
-random: drop randomly
2. Priority scheduling:
send highest priority queued packet (multiple classes, with different priorities)
3. Round Robin (RR) scheduling:
For multiple classes, More fairness than P.S.
It handles all processes without priority, and it is starvation-free.
Scan class queues, sending one complete packet from each class (if available).
4. Weighted Fair Queuing (WFQ):
generalized Round Robin
each class gets a weighted amount of service in each cycle.
More priority and more data will be served form highest priority queue.
IP: Internet Protocol
Fragmentation: if MTU link is smaller than the arrived pkt.
MTU: max transfer size: largest possible link-level frame. different link types, different MTUs
1. large IP datagram divided (“fragmented”) within net.
2. One datagram becomes several datagrams
3. Reassembled only at the final destination using IP header bits.
Offset field to arrange the fragment in correct order.
Frag flag 1 for all small pkts, but last pkt flag=0.
IPv4:
IP Address = 32 bits = 4 bytes. High order for subnet address, Low order for host number.
Interface: a connection between host/router and physical link. Each interface has a unique IP address.
Routers have multiple interfaces | Host typically has one or two interfaces
Subnet: device interfaces with same #subnet of IP add can communicate each other without intervening router.
Subnetting: Allow using single IP address in multiple interfaces using the subnet mask.
Subnet mask /a: a 1’s in high order to mask the #host in IP address to find subnet number. To simplify the job
of a router and shortening its routing table. a: #bits in subnet number of IP address.
Supernetting merge two or more IP add from the same class to get single IP add. The reverse of subnitting.
Prerequisites for subnetting:
1. Consecutive network addresses
2. Must be static addressing • First IP dividable on #of networks • Fall on the correct boundaries
IP Classes ….
CIDR: Classless InterDomain Routing
subnet portion of address of arbitrary length. Address format: a.b.c.d/x, where x is # bits in subnet portion of address
Broadcast: Send pkt to all nodes | Multicast: Sand pkt to a small group of nods | Unicast: Send pkt to specific node.
Routing Protocols: Find shortest paths, from sender to receiver, through a network of routers.
Shortest: least “cost”, “fastest”, “least congested”.
Path: sequence of routers, packets will traverse from given source to given destination.
Static: routes change slowly over time. router doesn't have a decision, just do forward.
Global Algo. : All routers have complete topology, link cost info.
“link state” algorithms: Exchanging neighbor's information with all nodes.
Broadcast update to all nodes / all nodes have same info
Many small msg include direct nodes info.
#iterations = #Nodes ; more complexity
Ex: OSPF (open shortest path first)
Dijkstra’s algorithm: O(n^2); each iteration: need to check all nodes
D(v): current value of cost of path from source to dest. V = min( D(v), D(w) + c(w,v) )
Dynamic: routes change more quickly. Need periodic update & in response to link cost changes.
Decentralized Algo. : router knows physically- connected/Direct neighbors, link costs to neighbors.
“Distance vector” algorithms: #nodes slots big messages to direct neighbors only. Iterative, asynchronous
Send update to direct nodes only
Few big msg include all nodes info.
#iterations < #Nodes < #iterations in link state ; less complexity Ex: RIP
Bellman-Ford equation:
dx(y): cost of least-cost path from x to y = min.v {c(x,v) + dv(y) }
Dx(y) = estimate of least cost from x to y = min.v {c(x,v) + Dv(y) }
Step1: see Direct neighbors only. Step2: see up to 2 hops away
..… stop when reach two steps with same table.
More than one path to destination AS, selects path based on:
1. local preference value attribute: policy decision 2. shortest AS-PATH
3. closest NEXT-HOP router: hot potato routing 4. additional criteria