Network Layers | Computer Communication and Networks
AbeeraMalik20
19 views
21 slides
Aug 22, 2024
Slide 1 of 21
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
About This Presentation
The transport layer is a fundamental component in the OSI (Open Systems Interconnection) and TCP/IP models of networking. It acts as a crucial intermediary between the network layer, which handles the routing and forwarding of data packets, and the application layer, where end-user applications and ...
The transport layer is a fundamental component in the OSI (Open Systems Interconnection) and TCP/IP models of networking. It acts as a crucial intermediary between the network layer, which handles the routing and forwarding of data packets, and the application layer, where end-user applications and services reside. The primary responsibility of the transport layer is to ensure that data is transmitted accurately and reliably from one host to another across a network. This layer facilitates communication between devices by providing end-to-end data transfer, error checking, and flow control.
Core Functions of the Transport Layer:
Segmentation and Reassembly:
The transport layer breaks down large data messages from the application layer into smaller segments that can be transmitted over the network. Each segment is then reassembled at the destination to recreate the original message. This process ensures that data can be efficiently managed and transmitted, even if it exceeds the maximum transmission unit (MTU) of the underlying network.
Reliable Data Transfer:
One of the critical roles of the transport layer is to ensure reliable communication. Protocols like TCP (Transmission Control Protocol) provide mechanisms such as acknowledgments, retransmissions, and sequencing to guarantee that data reaches its destination correctly and in the proper order. This reliability is crucial for applications like file transfers, email, and web browsing, where data integrity is paramount.
Flow Control:
The transport layer manages the rate at which data is sent between devices to prevent network congestion and ensure smooth communication. This is achieved through flow control mechanisms that adjust the rate of data transmission based on the network's capacity and the receiving device's ability to process the data. For example, TCP employs a sliding window protocol to dynamically adjust the flow of data based on the network's conditions.
Error Detection and Correction:
The transport layer is responsible for detecting errors that may occur during data transmission and taking corrective actions to ensure accurate delivery. This includes using checksums to verify the integrity of the data segments and requesting retransmission of corrupted or lost segments. By providing error correction, the transport layer enhances the reliability of data communication over potentially unreliable networks.
Multiplexing and Demultiplexing:
To facilitate communication between multiple applications on a single host, the transport layer uses port numbers to distinguish between different data streams. Multiplexing allows data from various applications to be combined and transmitted over a single network connection, while demultiplexing ensures that the data is delivered to the correct application at the receiving end. This capability is essential for supporting multiple concurrent connections, such as a web browser accessing several websites simultaneously.
Connection Establishment
Size: 1.09 MB
Language: en
Added: Aug 22, 2024
Slides: 21 pages
Slide Content
Computer Communication & Networks
Spring 2020 Semester
Department of Computer Software Engineering
Network Layer-Part-1
Readings:
1.ComputerNetworking:ATop-DownApproach,By:KuroseandRoss,Edition:6th,Publisher:Pearson,ISBN:0132856204,YearofPublication:2012,Chapter-4
2.TCP/IPProtocolSuite,4thEdition,ByBehrouzF.Forouzan-Chapter-14
Week-12
Online Lecture-06
Topics Discussed in Last Lecture
1.Packet Switching/Forwarding
•Source Routing
2. Evaluation of Packing Switching Techniques
3. Examination of IP Header
4. Fragmentation & Re-assembly
5. IP Addressing
Topics Discussed in this Lecture
CLO-2: Analyzethe service model of each layer in the TCP/IP protocol stack with respect to the protocols/algorithms.
Taxonomy Level: 4, PLO-2
1.Sub-nets and Subnet Masks
2.Dynamic Host Configuration Protocol (DHCP)
3.IP Forwarding
IP addressing: Revisited
Q: how are interfaces actually connected?
A: we’ll learn about that in chapter 5, 6.
223.1.1.1
223.1.1.4223.1.2.9
223.1.2.2
223.1.2.1
223.1.3.2223.1.3.1
223.1.3.27
A: wired Ethernet interfaces connected by
Ethernet switches
B: wireless WiFiinterfaces connected by WiFi
base station(AP)
223.1.1.2
223.1.1.3
Network ID: 223.1.1.0Network ID: 223.1.2.0
Network ID: 223.1.3.0
01
2
Forwarding Table on Router
Net IDInterface
233.1.2.00
233.1.1.01
233.1.3.02
recipe
vto determine the subnets, detach each interface from its host or router, creating islands of isolated networks
veach isolated network is called a subnet
vSubnet Mask: A mask associated with every IP address: Extract the subnet or net ID
vDefault subnet mask
vClass A: 255.0.0.0
vClass B: 255.255.0.0
vClass C: 255.255.255.0subnet mask: /24
Subnets
223.1.1.0/24223.1.2.0/24
223.1.3.0/24
223.1.1.1
223.1.1.3
223.1.1.4223.1.2.9
223.1.3.2223.1.3.1
subnet
223.1.1.2
223.1.3.27223.1.2.2
223.1.2.1
1
10
2
IP addresses: how to get one?
Q:How does a hostget IP address?
•hard-coded by system admin in a file
•Windows: control-panel->network->configuration->tcp/ip->properties
•UNIX: /etc/rc.config
•DHCP:Dynamic Host Configuration Protocol: dynamically get address from as server
•“plug-and-play”
DHCP: Dynamic Host Configuration Protocol
Goal:allow host to dynamically obtain its IP address from network server when it joins network
•can renew its lease on address in use
•allows reuse of addresses (only hold address while connected/“on”)
•support for mobile users who want to join network
DHCP overview:
•host broadcasts “DHCP discover”msg
•DHCP server responds with “DHCP offer”msg
•host requests IP address: “DHCP request”msg
•DHCP server sends address: “DHCP ack”msg
DHCP: more than IP addresses
DHCP can return more than just allocated IP address on subnet:
§address of first-hop router for client
§name and IP address of DNS sever
§network mask (indicating network versus host portion of address)
vconnecting laptop needs its IP address, addr of first-hop router, addr of DNS server: use DHCP
router with DHCP
server built into
router
vDHCP request encapsulated
in UDP, encapsulated in IP,
encapsulated in 802.3
Ethernet
vEthernet frame broadcast
(dest: FFFFFFFFFFFF) on LAN,
received at router running
DHCP server
vEthernet demuxed to IP
demuxed, UDP demuxed to
DHCP
168.1.1.1
DHCP
UDP
IP
Eth
Phy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCP
UDP
IP
Eth
Phy
DHCP
DHCP
DHCP
DHCPDHCP
DHCP: example
•DCP server formulates DHCP
ACK containing client’s IP
address, IP address of first-
hop router for client, name
& IP address of DNS server
vencapsulation of DHCP
server, frame forwarded to client, demuxing up to
DHCP at client
DHCP: example
router with DHCP
server built into
router
DHCP
DHCP
DHCP
DHCP
DHCP
UDP
IP
Eth
Phy
DHCP
DHCP
UDP
IP
Eth
Phy
DHCP
DHCP
DHCP
DHCP
vclient now knows its IP
address, name and IP address of DSN server, IP
address of its first-hop router
DHCP: Wireshark output (home LAN)
Message type: Boot Reply (2)
Hardware type: Ethernet
Hardware address length: 6
Hops: 0
Transaction ID: 0x6b3a11b7
Seconds elapsed: 0
Bootp flags: 0x0000 (Unicast)
Client IP address: 192.168.1.101 (192.168.1.101)
Your (client) IP address: 0.0.0.0 (0.0.0.0)
Next server IP address: 192.168.1.1 (192.168.1.1)
Relay agent IP address: 0.0.0.0 (0.0.0.0)
Client MAC address: Wistron_23:68:8a (00:16:d3:23:68:8a)
Server host name not given
Boot file name not given
Magic cookie: (OK)
Option: (t=53,l=1) DHCP Message Type = DHCP ACK
Option: (t=54,l=4) Server Identifier = 192.168.1.1
Option: (t=1,l=4) Subnet Mask = 255.255.255.0
Option: (t=3,l=4) Router = 192.168.1.1Option: (6) Domain Name Server
Length: 12; Value: 445747E2445749F244574092;
IP Address: 68.87.71.226;
IP Address: 68.87.73.242;
IP Address: 68.87.64.146
Option: (t=15,l=20) Domain Name = "hsd1.ma.comcast.net."
reply
Message type: Boot Request (1)
Hardware type: Ethernet
Hardware address length: 6
Hops: 0
Transaction ID: 0x6b3a11b7
Seconds elapsed: 0
Bootp flags: 0x0000 (Unicast)
Client IP address: 0.0.0.0 (0.0.0.0)
Your (client) IP address: 0.0.0.0 (0.0.0.0)
Next server IP address: 0.0.0.0 (0.0.0.0)
Relay agent IP address: 0.0.0.0 (0.0.0.0)
Client MAC address: Wistron_23:68:8a (00:16:d3:23:68:8a)
Server host name not given
Boot file name not given
Magic cookie: (OK)
Option: (t=53,l=1) DHCP Message Type = DHCP Request
Option: (61) Client identifier
Length: 7; Value: 010016D323688A;
Hardware type: EthernetClient MAC address: Wistron_23:68:8a (00:16:d3:23:68:8a)
Option: (t=50,l=4) Requested IP Address = 192.168.1.101
Option: (t=12,l=5) Host Name = "nomad"
Option: (55) Parameter Request List
Length: 11; Value: 010F03062C2E2F1F21F92B
1 = Subnet Mask; 15 = Domain Name
3 = Router; 6 = Domain Name Server
44 = NetBIOS over TCP/IP Name Server
……
request
Datagram Forwarding
•Every IP datagram contains source IP address and the IP address of the
destination host.
•e.g.,SrcIP: 192.168.1.4 and DestIP: 192.168.2.2
•The “network part” of an IP address uniquely identifies a single physical
network that is part of the larger Internet.
•e.g.,Network PartofSrcIP: 192.168.1 identifies a physical network which
is part of the global Internet
•NetID/Net Num: 192.168.1.0 (how it is being extracted?
•Mask 192.168.1.4 with “/24” or 255.255.255.0= 192.168.1.0
•NetworkpartofDestIP:192.168.2identifies a physical network on the
Internet
•Net ID/Net Num: 192.168.2.0
•Mask 192.168.2.2 with “/24” or255.255.255.0= 192.168.2.0
Part-3
Datagram Forwarding (1)
•All hosts and routers that share the same network part of their
addressare connected to the same physical network
•They cancommunicate with each other by sending frames
over that network.
•Every physical network that is part of the Internet has at least
one router that, by definition, is also connected to at least one
other physical network or router
•This router can exchange packets with hosts or routers on
either network.
Datagram Forwarding(2)
•A datagram is sent from a source host to a destination host
•What are the possibilities for the destination host location?
•Destinationcanbeonthesamephysicalnetwork(i.e.,thenetworkpart of IP address of the destination is similar to the network part of IP address of the source node)
•Example: SrcIP: 192.168.2.4 and DestIP: 192.168.2.212
•Destination can be on other physical network/sub-net (i.e, the network part of IP address of the destination is different from the network part of IP address of the source node
•Example: SrcIP: 192.168.2.4 and DestIP: 192.168.3.212
•Any node, first tries to find out whether it is connected to the same physical network as the destination node.
•How a node/host knows this ?
•If source and destination are on the same physical network then,
•Send the datagram directly to the destination
•You will definitely need destination MAC here to deliver it at the Data Link layer (another issue)
•Otherwise,
•Send it to the router.
•YouwillneedrouterMACaddresstodeliveritat the linklayer (another issue)
IP Forwarding-Example
223.1.1.1
223.1.1.4223.1.2.9
223.1.2.2
223.1.2.1
223.1.3.2223.1.3.1
223.1.3.27
223.1.1.2
223.1.1.3
Network ID: 223.1.1.0Network ID: 223.1.2.0
Network ID: 223.1.3.0
01
2
Forwarding Table on Router
Net IDNet MaskInterface
223.1.2.0255.255.255.00
223.1.1.0255.255.255.0 1
223.1.3.0255.255.255.0 2
For sending node:
Case-1:Let 223.1.1.1wants to send an IP packet to 223.1.1.2
•sending node finds out that they belong to same network so send it directly
Case-2:Let 223.1.1.1 wants to send an IP packet to 223.1.3.1
•sending node finds out that they don’t belong to the same network so send it to the default router(223.1.1.4)
IP Forwarding Example
Forwarding at the Router
•IPpacketwithdestinationIP:223.1.3.1 arrives at the router
•Router masks it with each entry in the forwarding table, if a match is found then it is sent on that interface.
•Mask with first entry in forwarding table i.e., 255.255.255.0, result 223.1.3.0, match not found as net ID there is 223.1.2.0
•Maskwithsecondentryinforwardingtable,i.e., 255.255.255.0, match is not found as net ID there is 223.1.1.0
•Mask with third entry in forwarding table, i.e., 255.255.255.0, match is found as net ID listed there is 223.1.3.0, send it on interface 2
223.1.1.1
223.1.1.4223.1.2.9
223.1.2.2
223.1.2.1
223.1.3.2223.1.3.1
223.1.3.27
223.1.1.2
223.1.1.3
Network ID: 223.1.1.0Network ID: 223.1.2.0
Network ID: 223.1.3.0
01
2
Forwarding Table on Router
Net IDNet MaskInterface
223.1.2.0255.255.255.00
223.1.1.0255.255.255.0 1
223.1.3.0255.255.255.0 2
Datagram Forwarding-Example-1
•H1 wants to send a datagram to H2
•H1 and H2 have the same network
number in their IP addresses
•H1deduces that it can deliver the
datagram directly to H2 over the
Ethernet.
•Issue -How H1 finds out the
correct Ethernet address for H2?
Datagram Forwarding-Example-2
•H1 wants to send a datagram to H8
•H1 and H8 have different network
number in their IP addresses
•What action will H1 take ?
•Send it to R1
•What action R1 will take ?
•Send it to R2
•And so on.....
Datagram Forwarding
Network #NetmaskNext Hop/Port
18.0.0.0255.0.0.01
128.32.0.0255.255.0.02
0.0.0.00.0.0.03 (Default route)
dest: 18.26.10.0mask with 255.0.0.0matched! send to port 1
dest: 128.16.14.0mask with 255.0.0.0not matched
mask with 255.255.0.0not matched
mask with 0.0.0.0matched! send to port 3