Professional Documents
Culture Documents
CCE 414 Lect 5 - Internetwork Layers 201
CCE 414 Lect 5 - Internetwork Layers 201
Christopher U. Ngene
Engr. Prof. Christopher U. Ngene, Dept. of Communication and Computer Engineering, ATBU , email:ngene@unimaid.edu.ng 1
CCE 514 Computer Architecture – 3 Units
Internetwork Layers
4. Transport Layer
Internetwork Layer
3. Network Layer
Engr. Prof. Christopher U. Ngene, Dept. of Communication and Computer Engineering, ATBU , email:ngene@unimaid.edu.ng 3
CCE 514 Computer Architecture – 3 Units
Encapsulation
As application data is passed down the protocol stack on its way to be
transmitted across the network media, various protocols add
information to it at each level. This is commonly known as the
encapsulation process.
The form that a piece of data takes at any layer is called a Protocol Data
Unit (PDU).
During encapsulation, each succeeding layer encapsulates the PDU
PDUs are named according to the protocols of the TCP/IP suite.
Data - The general term for the PDU used at the Application layer
Segment - Transport Layer PDU
Packet - Internetwork Layer PDU
Frame – Data Link Layer PDU
Bits - A PDU used when physically transmitting data over the medium
During the encapsulation process, Layer 3 receives the Layer 4 PDU and
adds a Layer 3 header, or label, to create the Layer 3 PDU.
Engr. Prof. Christopher U. Ngene, Dept. of Communication and Computer Engineering, ATBU , email:ngene@unimaid.edu.ng 4
CCE 514 Computer Architecture – 3 Units
Encapsulation
Engr. Prof. Christopher U. Ngene, Dept. of Communication and Computer Engineering, ATBU , email:ngene@unimaid.edu.ng 5
CCE 514 Computer Architecture – 3 Units
Routing
Next, the Network layer must provide services to direct these
packets to their destination host.
The source and destination hosts are not always connected to the
same network.
In fact, the packet might have to travel through many different networks.
Along the way, each packet must be guided through the network to reach its final
destination.
Intermediary devices that connect the networks are called routers.
The role of the router is to select paths for and direct packets toward their destination.
• This process is known as routing.
Each route that a packet takes to reach the next device is called a hop.
As the packet is forwarded, its contents (the Transport layer PDU),
remain intact until the destination host is reached.
Engr. Prof. Christopher U. Ngene, Dept. of Communication and Computer Engineering, ATBU , email:ngene@unimaid.edu.ng 6
CCE 514 Computer Architecture – 3 Units
Decapsulation
Finally, the packet arrives at the destination host and is
processed at Layer 3.
Engr. Prof. Christopher U. Ngene, Dept. of Communication and Computer Engineering, ATBU , email:ngene@unimaid.edu.ng 7
CCE 514 Computer Architecture – 3 Units
Transport Protocols
Provide logical communication between
application processes running on different
hosts
Run on end hosts
Sender: breaks application messages into segments,
and passes to network layer
Receiver: reassembles segments into messages,
passes to application layer
Multiple transport protocol available to
applications
Internet: TCP and UDP
Engr. Prof. Christopher U. Ngene, Dept. of Communication and Computer Engineering, ATBU , email:ngene@unimaid.edu.ng 8
CCE 514 Computer Architecture – 3 Units
Transport Protocols…
application
transport
provide logical network
data link
communication between physical
log
different hosts
ica
le
transport protocols run in
nd
en-
end systems
d
tra
send side: breaks app
ns
po
messages into segments,
rt
passes to network layer
application
recv side: reassembles transport
network
segments into messages, data link
physical
passes to app layer
more than one transport
protocol available to apps
Internet: TCP and UDP
Engr. Prof. Christopher U. Ngene, Dept. of Communication and Computer Engineering, ATBU , email:ngene@unimaid.edu.ng 9
Transmission Control
CCE 514 Computer Architecture – 3 Units
Engr. Prof. Christopher U. Ngene, Dept. of Communication and Computer Engineering, ATBU , email:ngene@unimaid.edu.ng 10
CCE 514 Computer Architecture – 3 Units
TCP Packet
Source Destination Sequence ACK Header Flow CRC-16 Urgent Options
Unused Flags
port port Number number length control pointer User Data
16 16 32 32 4 6 6 16 16 16 32 Varies
bits bits bits bits bits bits bits bits bits bits bits
Port Number:
A port number identifies the endpoint of a connection.
A pair <IP address, port number> identifies one endpoint of a
connection.
Two pairs <client IP address, server port number> and
<server IP address, server port number> identify a TCP
connection. Applications
23 80 104 Ports 7 80 16
TCP TCP
IP IP
Engr. Prof. Christopher U. Ngene, Dept. of Communication and Computer Engineering, ATBU , email:ngene@unimaid.edu.ng 12
CCE 514 Computer Architecture – 3 Units
Engr. Prof. Christopher U. Ngene, Dept. of Communication and Computer Engineering, ATBU , email:ngene@unimaid.edu.ng 15
CCE 514 Computer Architecture – 3 Units
Window Size:
Window size is the maximum number of bytes that a receiver can accept.
Each side of the connection advertises the window size
Maximum window size is 216-1= 65535 bytes
TCP Checksum:
TCP checksum covers both TCP header and TCP data (also covers some
parts of the IP header)
Urgent Pointer:
Only valid if URG flag is set
Engr. Prof. Christopher U. Ngene, Dept. of Communication and Computer Engineering, ATBU , email:ngene@unimaid.edu.ng 16
CCE 514 Computer Architecture – 3 Units
Port addresses are 2-bytes long. Usually, standard port numbers are used:
Web servers use port number 80
FTP servers use port number 21
Telnet, port number 23
SMTP uses port 25
Nonstandard port numbers are also possible, but TCP must be specially
configured to use them.
Engr. Prof. Christopher U. Ngene, Dept. of Communication and Computer Engineering, ATBU , email:ngene@unimaid.edu.ng 17
CCE 514 Computer Architecture – 3 Units
Segmenting
The application layer sees a message as a single block
(or stream) of data.
Engr. Prof. Christopher U. Ngene, Dept. of Communication and Computer Engineering, ATBU , email:ngene@unimaid.edu.ng 18
Connection-Oriented Routing
CCE 514 Computer Architecture – 3 Units
TCP
TCP also handles end-to-end routing, such as setting up a virtual circuit
(called connection-oriented routing).
Sending data on a virtual circuit means all packets in a message follow the
same route from source to destination.
The first step in creating a virtual circuit is for the sender to send a special
SYN packet, which requests the virtual circuit and negotiates with the receiver
over what packet size to use.
Following this, the packets are sent one by one in order from source to
destination using the continuous ARQ.
Finally, a special FIN packet is sent by TCP to close the virtual circuit.
HTTP, SMTP, FTP and Telnet all use TCP-based connection-oriented routing.
Engr. Prof. Christopher U. Ngene, Dept. of Communication and Computer Engineering, ATBU , email:ngene@unimaid.edu.ng 19
Connectionless Routing
CCE 514 Computer Architecture – 3 Units
UDP
Sending packets individually without using a virtual circuit is called
connectionless routing.
Each packet is sent independently of one another, routed separately and can
follow different routes and arrive at different times.
With the TCP/IP, the protocol used for connectionless routing is called User
Datagram Protocol (UDP).
UDP uses only a small packet header (only 8 bytes) that contains only four
fields (source port, destination port, message length and header checksum).
UDP is commonly used by protocols that send small control messages, such
as
Streaming multimedia,
Retransmitting lost/corrupted packets is not worthwhile
By the time the packet is retransmitted, it’s too late
E.g., telephone calls, video conferencing, gaming
DNS, DHCP, RIP and SNMP.
Overhead of connection establishment is overkill
Easier to have application retransmit if needed
Engr. Prof. Christopher U. Ngene, Dept. of Communication and Computer Engineering, ATBU , email:ngene@unimaid.edu.ng 20
CCE 514 Computer Architecture – 3 Units
Reliable Delivery
Reliable delivery means error detection and
correction occurs ensuring that packets are
delivered free of errors. TCP is a reliable protocol
Engr. Prof. Christopher U. Ngene, Dept. of Communication and Computer Engineering, ATBU , email:ngene@unimaid.edu.ng 23
CCE 514 Computer Architecture – 3 Units
Send segment 1
Send ACK 1
Receive ACK 1
Send segment 2
Time
Receive segment 2
Send ACK 2
Receive ACK 2
Send segment 3
Receive segment 3
Send ACK 3
Receive ACK 3
Engr. Prof. Christopher U. Ngene, Dept. of Communication and Computer Engineering, ATBU , email:ngene@unimaid.edu.ng 24
CCE 514 Computer Architecture – 3 Units
Engr. Prof. Christopher U. Ngene, Dept. of Communication and Computer Engineering, ATBU , email:ngene@unimaid.edu.ng 25
CCE 514 Computer Architecture – 3 Units
Send ACK 1
Receive segment 2
Time
Send ACK 2
Receive segment 3
Engr. Prof. Christopher U. Ngene, Dept. of Communication and Computer Engineering, ATBU , email:ngene@unimaid.edu.ng 26
CCE 514 Computer Architecture – 3 Units
Network Layer
The protocols of the OSI model Network layer specify
addressing and processes that enable Transport layer data to
be packaged and transported.
Engr. Prof. Christopher U. Ngene, Dept. of Communication and Computer Engineering, ATBU , email:ngene@unimaid.edu.ng 28
CCE 514 Computer Architecture – 3 Units
forwarding data
plane (hardware)
high-seed
switching
fabric
lookup,
link forwarding
line layer switch
termination protocol fabric
(receive)
queueing
physical layer:
bit-level reception
data link layer: decentralized switching:
e.g., Ethernet given datagram dest., lookup output
see chapter 5 port using forwarding table in input
port memory (“match plus action”)
goal: complete input port processing
at ‘line speed’
queuing: if datagrams arrive faster
than forwarding rate into switch fabric
Engr. Prof. Christopher U. Ngene, Dept. of Communication and Computer Engineering, ATBU , email:ngene@unimaid.edu.ng 30
CCE 514 Computer Architecture – 3 Units
Output Ports
datagram
switch buffer link
fabric layer line
protocol termination
(send)
queueing
buffering required when datagrams arrive from fabric faster than the
transmission rate
Engr. Prof. Christopher U. Ngene, Dept. of Communication and Computer Engineering, ATBU , email:ngene@unimaid.edu.ng 31
CCE 514 Computer Architecture – 3 Units
Switching Fabrics
Transfer packet from input to correct output buffer
memory
Engr. Prof. Christopher U. Ngene, Dept. of Communication and Computer Engineering, ATBU , email:ngene@unimaid.edu.ng 32
CCE 514 Computer Architecture – 3 Units
input output
port memory port
(e.g., (e.g.,
Ethernet) Ethernet)
system bus
Engr. Prof. Christopher U. Ngene, Dept. of Communication and Computer Engineering, ATBU , email:ngene@unimaid.edu.ng 33
CCE 514 Computer Architecture – 3 Units
bus
Engr. Prof. Christopher U. Ngene, Dept. of Communication and Computer Engineering, ATBU , email:ngene@unimaid.edu.ng 34
CCE 514 Computer Architecture – 3 Units
crossbar
Engr. Prof. Christopher U. Ngene, Dept. of Communication and Computer Engineering, ATBU , email:ngene@unimaid.edu.ng 35
CCE 514 Computer Architecture – 3 Units
IPv4: uses a 160 bit (20 byte) header, and 32 bit addresses.
IPv6 uses a 320 bit (40 byte) header and 128 bit addresses.
Internet Protocol
Internet Protocol packet ver. 4 (IP v4)
Version Header Type of Total Identifiers Flags Packet Hop Protocol CRC Source DestinationOptions User
number length service length offset limit 16 Address Address data
4 4 8 16 16 3 13 8 8 16 32 32 32 Varies
bits bits bits bits bits bits bits bits bits bits bits bits bits
Version Header Flow Total Next Hop Source Address Destination User data
number Priority name length Header limit Address
Engr. Prof. Christopher U. Ngene, Dept. of Communication and Computer Engineering, ATBU , email:ngene@unimaid.edu.ng 37
CCE 514 Computer Architecture – 3 Units
Engr. Prof. Christopher U. Ngene, Dept. of Communication and Computer Engineering, ATBU , email:ngene@unimaid.edu.ng 38
CCE 514 Computer Architecture – 3 Units
physical layer
Engr. Prof. Christopher U. Ngene, Dept. of Communication and Computer Engineering, ATBU , email:ngene@unimaid.edu.ng 39
CCE 514 Computer Architecture – 3 Units
IP fragmentation, reassembly
network links have MTU
(max. transfer unit) that
limits link-layer frame size
different link types have fragmentation:
in: one large datagram
different MTUs out: 3 smaller datagrams
large IP datagram
chopped (“fragmented”) Reassembly
in network into several Fragments
datagrams
“reassembled” only at final
destination
IP header bits used to
identify, order fragments
IP fragmentation, reassembly…
example:
4000 byte datagram length ID fragflag offset
(20 bytes IP header + =4000 =x =0 =0
3980 data bytes( IP
payload)) one large datagram becomes
several smaller datagrams
MTU = 1500 bytes
1480 bytes in length ID fragflag offset
data field =1500 =x =1 =0
Engr. Prof. Christopher U. Ngene, Dept. of Communication and Computer Engineering, ATBU , email:ngene@unimaid.edu.ng 42
CCE 514 Computer Architecture – 3 Units
Addressing
Engr. Prof. Christopher U. Ngene, Dept. of Communication and Computer Engineering, ATBU , email:ngene@unimaid.edu.ng 43
CCE 514 Computer Architecture – 3 Units
Assigning Addresses
The Internet uses three kinds of addresses:
Application layer addresses (domain names) are assigned by
network managers and placed in configuration files.
Some servers have more than one application layer address
Network layer addresses (IP addresses) are also assigned by
network managers, or by programs such as DHCP, and placed in
configuration files.
Every network on the Internet is assigned a range of possible IP addresses
for use on its network
Data link layer addresses are hardware addresses placed on
network interface cards by their manufacturers
IPv4
IPv4, uses 4 byte (32 bit) addresses which are really
strings of 32 bits.
Engr. Prof. Christopher U. Ngene, Dept. of Communication and Computer Engineering, ATBU , email:ngene@unimaid.edu.ng 45
CCE 514 Computer Architecture – 3 Units
32 bits
194 168 18 57
Network Host
Engr. Prof. Christopher U. Ngene, Dept. of Communication and Computer Engineering, ATBU , email:ngene@unimaid.edu.ng 46
CCE 514 Computer Architecture – 3 Units
Media Independent
Operates independently of the medium carrying the data.
Engr. Prof. Christopher U. Ngene, Dept. of Communication and Computer Engineering, ATBU , email:ngene@unimaid.edu.ng 47
CCE 514 Computer Architecture – 3 Units
Connectionless
Engr. Prof. Christopher U. Ngene, Dept. of Communication and Computer Engineering, ATBU , email:ngene@unimaid.edu.ng 48
CCE 514 Computer Architecture – 3 Units
Best Effort
Media Independent
The Network layer is also not burdened with the
characteristics of the media on which packets will be
transported.
IPv4 and IPv6 operate independently of the media that
carry the data at lower layers of the protocol stack.
There is, however, one major characteristic of the media
that the Network layer considers: the maximum size of
PDU that each medium can transport.
This characteristic is referred to as the Maximum Transmission Unit
(MTU).
MTU – Maximum packet size, in bytes, that a particular interface can
handle
Engr. Prof. Christopher U. Ngene, Dept. of Communication and Computer Engineering, ATBU , email:ngene@unimaid.edu.ng 50
CCE 514 Computer Architecture – 3 Units
Class A
A class A address block was designed to support extremely large networks
with more than 16 million host addresses.
Class A IPv4 addresses used a fixed /8 prefix with the first octet to indicate
the network address. The remaining three octets were used for host
addresses.
Class B
Class B address space was designed to support the needs of moderate to
large size networks with more than 65,000 hosts. A class B IP address used
the two high-order octets to indicate the network address.
Engr. Prof. Christopher U. Ngene, Dept. of Communication and Computer Engineering, ATBU , email:ngene@unimaid.edu.ng 51
CCE 514 Computer Architecture – 3 Units
32 bits
Network
Host Identifier
Class A Identifier
0 8 16 24 32
0 8 16 24 32
0 8 16 24 32
Engr. Prof. Christopher U. Ngene, Dept. of Communication and Computer Engineering, ATBU , email:ngene@unimaid.edu.ng 52
CCE 514 Computer Architecture – 3 Units
Engr. Prof. Christopher U. Ngene, Dept. of Communication and Computer Engineering, ATBU , email:ngene@unimaid.edu.ng 53
CCE 514 Computer Architecture – 3 Units
Engr. Prof. Christopher U. Ngene, Dept. of Communication and Computer Engineering, ATBU , email:ngene@unimaid.edu.ng 54
CCE 514 Computer Architecture – 3 Units
IPv6 Motivation
initial motivation: 32-bit address space soon to be
completely allocated.
additional motivation:
header format helps speed processing/forwarding
header changes to facilitate QoS
Engr. Prof. Christopher U. Ngene, Dept. of Communication and Computer Engineering, ATBU , email:ngene@unimaid.edu.ng 58
CCE 514 Computer Architecture – 3 Units
data
32 bits
Engr. Prof. Christopher U. Ngene, Dept. of Communication and Computer Engineering, ATBU , email:ngene@unimaid.edu.ng 59
CCE 514 Computer Architecture – 3 Units
Engr. Prof. Christopher U. Ngene, Dept. of Communication and Computer Engineering, ATBU , email:ngene@unimaid.edu.ng 60
CCE 514 Computer Architecture – 3 Units
IPv6 datagram
IPv4 datagram
Engr. Prof. Christopher U. Ngene, Dept. of Communication and Computer Engineering, ATBU , email:ngene@unimaid.edu.ng 61
CCE 514 Computer Architecture – 3 Units
Tunneling
A B IPv4 tunnel E F
connecting IPv6 routers
logical view:
IPv6 IPv6 IPv6 IPv6
A B C D E F
physical view:
IPv6 IPv6 IPv4 IPv4 IPv6 IPv6
data data
A-to-B: E-to-F:
IPv6 B-to-C: B-to-C: IPv6
IPv6 inside IPv6 inside
IPv4 IPv4
Engr. Prof. Christopher U. Ngene, Dept. of Communication and Computer Engineering, ATBU , email:ngene@unimaid.edu.ng 62
Who Assigns the Different
CCE 514 Computer Architecture – 3 Units
Addresses
IP address assignment is managed by ICANN (Internet
Corporation for Assigned Names and Numbers)
ICANN is a non-profit corporation that was formed to assume
responsibility for the IP address space allocation,
protocol parameter assignment,
domain name system management, and
root server system management functions previously performed
under U.S. Government contract by IANA and other entities
Addresses...
Internet Assigned Numbers Authority (IANA) ( http://www.iana.net ) is the
master holder of the IP addresses.
IANA is a department of ICANN
The IP multicast addresses and the IPv6 addresses are obtained directly from
IANA. Until the mid-1990s, all IPv4 address space was managed directly by the
IANA. At that time, the remaining IPv4 address space was allocated to various
other registries to manage for particular purposes or for regional areas.
These registration companies are called Regional Internet Registries (RIRs).
Engr. Prof. Christopher U. Ngene, Dept. of Communication and Computer Engineering, ATBU , email:ngene@unimaid.edu.ng 64