Lecture 4-Layers and TCP
Lecture 4-Layers and TCP
2.1 .
A Network is ..
A combination of hardware (HW) and software (SW) that
send data from one location to another.
HW: physical equipment that carries signals from
2.2
Network Protocol
TCP/IP architecture
2.3
Concept of Layers
2.5
3 Layer Protocol
2.6
Tasks involved in sending a letter
2.7
Hierarchy
The tasks must
be performed in
the order
specified by the
hierarchy of the
layers!
2.8
Concept of Layers
Each layer provides a specific set of services.
Services are provided through the definition of protocols.
Each layer uses the services provided by the lower/above
layers.
Layers use protocols to communicate with each others.
Layering provides two nice features:
Decomposes the problem of building a network into
entire system.
2.9
Advantages of Protocol Layering
Separation of services from implementation becomes
possible
A layer should be able to receive the services from
2.10
Principles of Protocol Layering
2 principles for bidirectional communication
Each layer should be able to perform opposite tasks in
each direction.
First layer: Send/Receive
2.11
Layer-to-Layer communication
2.12
TCP/IP PROTOCOL SUITE
• Transmission Control Protocol/Internet Protocol
• Used in the internet today
• TCP/IP is a hierarchical protocol made up of interactive modules, each of
which provides a specific functionality.
• The layers of the TCP/IP protocol suite contain relatively independent
protocols.
• The application uses the best suited protocol from each layer.
• The term hierarchical means that each upper-level protocol is supported
by one or more lower-level protocols.
• The original TCP/IP protocol suite was defined as having four layers:
host-to-network, internet, transport, and application.
• Today TCP-IP is considered to have a 5-layer model
2.13
TCP/IP PROTOCOL SUITE
2.14
• Communication from A to B
• 5 communication devices
• Router connects networks
with different protocols
• Switch connects same links
2.15
2.16
2.17
The Layers in the TCP/IP Protocol Suite
Application
Presentation FTP HTTP DNS NFS …
Session
Network IP
ARP RARP
Data link
Physical
Figure 2.16 TCP/IP and OSI model
18
2-4 TCP/IP PROTOCOL SUITE
Physical Layer
Carries individual bits in a frame across the link.
assumed)
2.19
2-4 TCP/IP PROTOCOL SUITE
Data Link Layer
A network in a TCP/IP internetwork can be a local-area
2.20
2-4 TCP/IP PROTOCOL SUITE
destination computers
Host-to-host communication but routers are responsible for
2.21
2-4 TCP/IP PROTOCOL SUITE
2.22
2-4 TCP/IP PROTOCOL SUITE
(segment or user-datagram).
In this layer, the protocol is responsible for delivery of
2.24
Protocols at The Transport Layer
Transmission Control Protocol (TCP)
It is reliable and connection-oriented.
Creates logical connections between transport layers of 2
hosts for transmitting bytes.
Provides flow control (matches data rate of the source host
with the destination host), error control (ensures that packets
are sent without error or retransmits) and congestion control
(to prevent the packet loss).
2.25
Protocols at The Transport Layer
User Datagram Protocol (UDP)
Connection-less, does not work with the logical connections.
Each user datagram is sent as a separate entity.
Does not provide error, flow or congestion control
functionalities.
Has small overhead and used by the applications having small
packets.
2.26
2-4 TCP/IP PROTOCOL SUITE
Application Layer
Two application layers exchange messages between
2.28
Encapsulation & Decapsulation
2.29
Encapsulation At Sender
Application Layer
Message is generated
Transport Layer
Takes application layer message as the payload and adds header to it
Headers contain identifier information of the source & destination and
some information required for the end-to-end delivery.
Information about error control, flow control or congestion control.
User datagram or segment is made
Network layer
Takes transport layer message as the payload and adds header
Headers contain identifier information of the source & destination and
some information for error checking and fragmentation
Datagram is made
Data Link Layer
Takes network layer message as the payload and adds header
Adds link layer addresses of the host or the next hop (router).
Link layer packet is called a frame
2.30
At Router
Both encapsulation and decapsulation
Data link layer decapsulates the received bits (datagram) from the
frame and passes to the network layer.
Network layer inspects the source & destination addresses in the
datagram and uses the forwarding table to find the next hop.
Contents of datagram are only changed by the router in case
fragmentation is needed.
Data link layer of the next link encapsulates the packet again using
the information of the next hop and passes to the physical layer.
2.31
Decapsulation at Destination
Each layer only decapsulates the packets, removes the header and delivers
to the next higher layer.
Decapsulation includes the process of error checking.
2.32
Figure 2.17 Addresses in TCP/IP
2.33
Addressing
2.34
Figure 2.18 Relationship of layers and addresses
in TCP/IP
2.35
Addressing Concepts
Logical connections exist between source and destination
hosts.
Two addresses are needed for communication.
Four pairs of addresses in TCP/IP architecture.
Relationship between address and the packet name at each
layer
Application layer: names (such as websites or email IDs)
Transport Layer: Port numbers (local addresses)
Network layer: Global addresses
Link-Layer: MAC addresses
2.36
2-5 ADDRESSING
Physical/Data Link Addresses
It is known as link address.
It is the address of a node as defined
by its LAN or WAN.
The size and format of the address
depend on the network.
Ethernet uses 6-bytes (48-bits)
NIC
LocalTalk (Apple) uses 1-byte
dynamic address
2.37
Example 2.1
2.38
Figure 2.19 Physical addresses
2.39
Example 2.3
2.40
Figure 2.20 IP addresses
2.41
Note
2.42
2-5 ADDRESSING
Port Addresses
It is necessary for the receiver device
that runs multiple process to receive
data simultaneously this make a
need to label each process
A port address is 16-bits.
2.43
Example 2.4
2.44
Figure 2.21 Port addresses
2.45
Note
2.46
2-5 ADDRESSING
Specific Addresses
Examples
e-mail address
URL address
2.47
Multiplexing & Demultiplexing
2.48
Multiplexing & Demultiplexing
A protocol at a layer can encapsulate packets from several protocols
running at the higher layers.
A protocol at a layer can decapsulate packets from several protocols
running at the lower layers.
Packet should have a field in its header field to identify its belonging
protocol
Transport layer: TCP & UDP could receive a message from different
application-layer protocols.
Network: IP can accept segment from TCP or user datagram from
UDP, or packets from ICMP, IGMP.
Data link layer: may carry the packets coming from IP or ARP.
2.49
Summary of TCP/IP
2.50