You are on page 1of 25

EE5150, Communication Networks

(January - May 2024, IIT Madras)

1. The Network Layer: Data Plane

• network layer provides host-to-host communication service


• there is a piece of the network layer in each and every host and router in the
network
• network layer - data plane and control plane
– data plane: focus on switching, IP forwarding and generalized forwarding,
IPv4 and IPv6 and addressing
– control plane: routing, routing algorithms and protocols, SDN

1
2. Overview of Network Layer

• host encapsulates transport layer segments into network layer datagrams and
forwards to a router
• intermediate routers forward data onto appropriate links and eventually to end
destination router
• network layer functions
– forwarding, blocking and duplicating; typically supported by a forwarding
table
– routing; (forwarding tables are) supported by distributed routing protocols
• typically forwarding is implemented in hardware while routing is implemented
in software

2
• Control plane: The SDN approach

• Network service model


– defines the characteristics of end-to-end delivery of packets between sending
and receiving hosts
– possible service guarantees
∗ guaranteed delivery
∗ guaranteed delivery with bounded delay
∗ in-order packet delivery
∗ guaranteed minimum bandwidth
∗ security
– The Internet’s network layer provides best-effort service
∗ compare it to ATM and Intserv architecture
∗ adequate bandwidth provisioning combined with adaptive transport layer
protocols works effectively!

3
3. A router

• router components - input ports, switching fabric, output ports, routing processor
• routing processor executes routing protocols, maintains routing tables and link
state information, and computes forwarding table for the router; in SDN frame-
work, the routing processor communicates with the remote controller
• ports and switching fabric are almost always implemented in hardware
– routers data plane operates at nanosecond time scale while routers control
plane operate at milli-seconds/seconds time scale
– control plane is typically implemented in software on a routing processor

4
• Input port processing and destination based forwarding

– forwarding decisions may be copied locally at the ports for line-speed oper-
ation
– there are more than 4 billion IP addresses; destination address ranges may be
mapped onto ports based on select bits (e.g., prefix of destination address)

– longest prefix match must be efficient for Gbps/Tbps operations


– packets are forwarded to the switching fabric after the destination port is
identified; here, packets may be blocked, queued or scheduled later;
– other operations performed at the input ports (beyond lookup)
∗ physical and link layer processing
∗ packets IP version number, checksum and time-to-live must be verified
∗ network management counters must be updated
– destination address based forwarding are a special case of “match plus ac-
tion” frameworks
∗ actions include dropping packets, updating fields, etc

5
• Switching
– packets are switched from an input port to an output port

6
• Outport port processing

– queueing may happen at the input port or the output port depending on the
traffic load, speed of switching fabric and line speed

7
– packet loss will happen if the queues (memory) overflow
∗ newly arriving packets may be dropped (drop-tail) if the buffer is full
∗ packets may be dropped even before the buffer is full to signal transport
layer protocols regarding congestion
∗ proactive packet dropping and marking policies studied under active
queue management (AQM) algorithms
– packets in a queue need to be dequeued for switching or for service
∗ first come first serve scheduling policies are popular
– How much buffer should be provisioned?
∗ rule of thumb recommends a buffer size equal to the bandwidth-delay
product
∗ large buffers may cause large (queueing) delays
∗ tradeoff between short-term statistical fluctuations in traffic vs increased
queuing and round trip delay

8
• packet scheduling
– first in first out (FIFO); packets are removed from the queue after transmis-
sion over the outgoing link

– priority queueing; for real-time packets and management packets; can be


preemptive or non-preemptive!

9
– round robin and weighted fair queueing; often, a work conserving queue
implements RR or WFQ

10
4. The Internet Protocol (IP): IPv4, addressing and more

• IPv4 (RFC 791) and IPv6 (RFC 2460, RFC 4291)


• IPv4 datagram format
– IP datagram has at least 20 bytes of header (assuming no options)

11
• IPv4 addressing
– an IP address is technically associated with an interface, rather than with
the host or router containing that interface
– each IP address is 32-bit long (approx 4 billion addresses)
– dotted-decimal notation, e.g., 192.168.1.1
– IP addresses are globally unique (except for interfaces behind NATs)
– a portion of the IP address is determined by the subnet to which it is con-
nected
– subnet address: 223.1.1.0/24

To determine the subnets, detach each interface from its host or router, creating
islands of isolated networks, with interfaces terminating the end points of the
isolated networks. Each of these isolated networks is called a subnet.

12
• The Internet’s address assignment strategy is known as Classless Interdomain
Routing (CIDR)
– 32-bit address is divided into two parts - a.b.c.d/x, where x indicates the
number of bits in the first part of the address.
– x constitutes the network portion of the address (prefix)
– an organization is typically assigned a range of addresses with a common
prefix - simplifies forwarding tables in the Internet
– 255.255.255.255 is the broadcast address within the subnet

13
• Obtaining a block of addresses
– obtain IP addresses from the ISP

– IP addresses are managed under the authority of the Internet Corporation


for Assigned Names and Numbers (ICANN)
• Obtaining a host address: The dynamic host configuration protocol (DHCP)
– ip addresses may be assigned manually or can be via DHCP (RFC 2131)
– DHCP allows a host to obtain (be allocated) an IP address automatically.
– address assigned can be permanent or temporary
– DHCP also allows a host to learn additional information, such as its subnet
mask, the address of its first-hop router (often called the default gateway),
and the address of its local DNS server
– DHCP is often referred to as a plug-and-play or zeroconf (zero-configuration)
protocol
– popular in residential Internet access networks, enterprise networks, and in
wireless LANs

14
• DHCP
– DHCP is a client-server protocol
– DHCP server may be present in the subnet or a DHCP relay agent may help
identify the server

15
• Network Address Translation (NAT, RFC 2663; RFC 3022)
– 10.0.0.0/24 - private addresses

– NAT router behaves to the outside world as a single device with a single IP
address
– The router gets its address from the ISP’s DHCP server, and the router runs
a DHCP server to provide addresses to computers within the NAT-DHCP-
router-controlled home network’s address space
– NAT translation table uses IP address and port number to identify client
devices and ports

16
• IPv6

17
18
5. Generalized Forwarding and SDN

• generalized match-and-action pardigm


– match can be made over multiple header fields
– action can include forwarding the packet to one or more output ports,
load balancing across multiple interfaces, rewriting header values, block-
ing/dropping a packet (as in a firewall), sending a packet to a special server
for further processing and action (as in DPI), and more.
• devices are called as packet switches

19
• OpenFlow standard (ONF 2020)
• Each entry in the match-plus-action forwarding table, known as a flow table in
OpenFlow, includes
– A set of header field values to which an incoming packet will be matched

∗ match based on wild-cards are permitted


– A set of counters that are updated as packets are matched to flow table
entries
– A set of actions to be taken when a packet matches a flow table entry
∗ forwarding, dropping and modifying field

20
21
6. Principles of the Internet

• provide connectivity
• one network layer protocol (IP)

• intelligence at the edge

22
1 Exercises
1. Let’s review some of the terminology used in this textbook. Recall that the name of
a transport-layer packet is segment and that the name of a link-layer packet is frame.
What is the name of a network-layer packet? Recall that both routers and link-layer
switches are called packet switches. What is the funda- mental difference between a
router and link-layer switch? (R1)

2. What is an essential different between RR and WFQ packet scheduling? Is there a


case (Hint: Consider the WFQ weights) where RR and WFQ will behave exactly the
same? (R16)

3. Suppose Host A sends Host B a TCP segment encapsulated in an IP data- gram.


When Host B receives the datagram, how does the network layer in Host B know it
should pass the segment (that is, the payload of the datagram) to TCP rather than
to UDP or to some other upper-layer protocol? (R17)

4. What is the 32-bit binary equivalent of the IP address 202.3.14.25? (R22)

5. Visit a host that uses DHCP to obtain its IP address, network mask, default router,
and IP address of its local DNS server. List these values. (R23)

6. Suppose an application generates chunks of 40 bytes of data every 20 msec, and


each chunk gets encapsulated in a TCP segment and then an IP datagram. What
percentage of each datagram will be overhead, and what percentage will be application
data? (R25)

7. Compare and contrast the IPv4 and the IPv6 header fields. Do they have any fields
in common? (R30)

8. Name three header fields in an IP datagram that can be “matched” in Open- Flow
1.0 generalized forwarding. What are three IP datagram header fields that cannot be
“matched” in OpenFlow? (R35)

9. Consider the network below. (P1)

(a) Show the forwarding table in router A, such that all traffic destined to host H3
is forwarded through interface 3.
(b) Can you write down a forwarding table in router A, such that all traffic from
H1 destined to host H3 is forwarded through interface 3, while all traffic from
H2 destined to host H3 is forwarded through interface 4? (Hint: This is a trick
question.)

10. Consider the switch shown below. Suppose that all datagrams have the same fixed
length, that the switch operates in a slotted, synchronous manner, and that in one time
slot a datagram can be transferred from an input port to an output port. The switch
fabric is a crossbar so that at most one datagram can be transferred to a given output
port in a time slot, but different output ports can receive datagrams from different
input ports in a single time slot. What is the minimal number of time slots needed

23
to transfer the packets shown from input ports to their output ports, assuming any
input queue scheduling order you want (i.e., it need not have HOL blocking)? What
is the largest number of slots needed, assuming the worst-case scheduling order you
can devise, assuming that a non-empty input queue is never idle? (P4)

11. Suppose that the WEQ scheduling policy is applied to a buffer that supports three
classes, and suppose the weights are 0.5, 0.25, and 0.25 for the three classes. (P5)

(a) Suppose that each class has a large number of packets in the buffer. In what
sequence might the three classes be served in order to achieve the WFQ weights?
(For round robin scheduling, a natural sequence is 123123123 . . .).
(b) Suppose that classes 1 and 2 have a large number of packets in the buffer, and
there are no class 3 packets in the buffer. In what sequence might the three
classes be served in to achieve the WFQ weights?

12. Consider the figure below. Answer the following questions: (P6)

(a) Assuming FIFO service, indicate the time at which packets 2 through 12 each
leave the queue. For each packet, what is the delay between its arrival and the
beginning of the slot in which it is transmitted? What is the average of this
delay over all 12 packets?
(b) Now assume a priority service, and assume that odd-numbered packets are high
priority, and even-numbered packets are low priority. Indicate the time at which
packets 2 through 12 each leave the queue. For each packet, what is the delay
between its arrival and the beginning of the slot in which it is transmitted? What
is the average of this delay over all 12 packets?
(c) Now assume round robin service. Assume that packets 1, 2, 3, 6, 11, and 12 are
from class 1, and packets 4, 5, 7, 8, 9, and 10 are from class 2. Indicate the time
at which packets 2 through 12 each leave the queue. For each packet, what is
the delay between its arrival and its departure? What is the average delay over
all 12 packets?
(d) Now assume weighted fair queuing (WFQ) service. Assume that odd- numbered
packets are from class 1, and even-numbered packets are from class 2. Class 1
has a WFQ weight of 2, while class 2 has a WFQ weight of 1. Note that it
may not be possible to achieve an idealized WFQ schedule as described in the
text, so indicate why you have chosen the particular packet to go into service
at each time slot. For each packet what is the delay between its arrival and its
departure? What is the average delay over all 12 packets?
(e) What do you notice about the average delay in all four cases (FIFO, RR, priority,
and WFQ)?

13. Consider a router that interconnects three subnets: Subnet 1, Subnet 2, and Subnet
3. Suppose all of the interfaces in each of these three subnets are required to have
the prefix 223.1.17/24. Also suppose that Subnet 1 is required to support at least 60
interfaces, Subnet 2 is to support at least 90 interfaces, and Subnet 3 is to support

24
at least 12 interfaces. Provide three network addresses (of the form a.b.c.d/x) that
satisfy these constraints. (P11)

14. Suppose datagrams are limited to 1,500 bytes (including header) between source Host
A and destination Host B. Assuming a 20-byte IP header, how many datagrams would
be required to send an MP3 consisting of 5 million bytes? Explain how you computed
your answer. (P17)

15. Consider again the SDN OpenFlow network shown in Figure 4.30. Suppose we want
switch s2 to function as a firewall. Specify the flow table in s2 that implements the
following firewall behaviors (specify a different flow table for each of the four firewalling
behaviors below) for delivery of datagrams destined to h3 and h4. You do not need
to specify the forwarding behavior in s2 that forwards traffic to other routers. (P24)

(a) Only traffic arriving from hosts h1 and h6 should be delivered to hosts h3 or h4
(i.e., that arriving traffic from hosts h2 and h5 is blocked).
(b) Only TCP traffic is allowed to be delivered to hosts h3 or h4 (i.e., that UDP
traffic is blocked).
(c) Only traffic destined to h3 is to be delivered (i.e., all traffic to h4 is blocked).
(d) Only UDP traffic from h1 and destined to h3 is to be delivered. All other traffic
is blocked.

2 Reference
1. Chapter 4 (The Network Layer: Data Plane) of Kurose and Ross, Computer network-
ing: A top-down approach

25

You might also like