Chapter 4-7@networking Models
Chapter 4-7@networking Models
1
THE OSI MODEL
3
The principal motivation for the development
of the OSI model
5
Why layered communication?
• To reduce complexity of communication task by
splitting it into several layered small tasks
• assists in protocol design
• fosters competition
• changes in one layer do not affect other layers
• provides a common language
6
OSI layers
7
Summary of OSI Layers
8
LAYER 7: APPLICATION
9
LAYER 6: PRESENTATION
11
LAYER 4: TRANSPORT
• It regulates information flow to ensure process-to- process connectivity
between host applications reliably and accurately
• Adds service point address or Port address
• Segmentation & Re-assembly: SEGMENTS data from sending node and
reassembles data on receiving node
• Flow control / Error control at Source to destination level
• Connection oriented transport service ensures that data is delivered error
free, in sequence with no losses or duplications
• Establishes, maintains and terminates virtual circuits
15
Layer 2 Frames
16
Layer 1: Physical Layer
• Physical Layer
– Define physical characteristics of network. E.g. wires,
connector, voltages, data rates, Asynchronous,
Synchronous Transmission
– Handles bit stream or binary transmission
– Used to maintain, activate and deactivate physical link.
– For receiver it reassembles bits and send to upper
layer for frames.
– For Sender it convert frames
into bit stream and send on
transmission medium. 17
Properties Physical Layers
• Deals with bit stream.
• Transmits raw bit stream over physical cable
• defines cables, cards, and physical aspects
• defines NIC attachments to hardware, how
cable is attached to NIC
• defines techniques to transfer bit stream to
cable
• Layer 1 Device: Repeater, Hub, Multiplexer
18
Physical layer
physical
connection
19
Difference between Layer 1 and Layer 2
23
The key features of a protocol
In the context of data networking, a protocol is a
formal set of rules and conventions that governs
how computers exchange information over a
network medium.
The peer layers communicate by means of
formatted blocks of data that obey a set of rules or
conventions known as a protocol. The key features
of protocol are:
• Syntax – data block format
• Semantics - control info. & error handling
• Timing - speed matching & sequencing 24
OSI and TCP/IP similarities
Similarities include:
• Both have layers.
• Both have application layers, though they include very different
services.
• Both have comparable transport and network layers.
• Both assume packets are switched. This means that individual
packets may take different paths to reach the same
destination. This is contrasted with circuit-switched networks
where all the packets take the same path.
25
OSI and TCP/IP Differences
Differences include:
• TCP/IP combines the presentation and session layer issues into its
application layer.
• TCP/IP combines the OSI data link and physical layers into the
network access layer.
• TCP/IP appears simpler because it has fewer layers.
• TCP/IP protocols are the standards around which the Internet developed,
so the TCP/IP model gains credibility just because of its protocols.
• In contrast, networks are not usually built on the OSI protocol, even
though the OSI model is used as a guide.
26
27
TCP/IP: Process/application layer
• These processes integrate the various activities
and duties spanning the focus of the OSI’s
corresponding top three layers (Application,
Presentation, and Session).
• Controls user-interface specifications.
• A vast array of protocols join forces at the DoD
model’s Process/Application layer.
28
TCP/IP: Host-to-Host/Transport layer
• The Host-to-Host layer parallels the functions of
the OSI’s Transport layer, defining protocols for
setting up the level of transmission service for
applications.
• It tackles issues like creating reliable end-to-end
communication and ensuring the error-free
delivery of data.
• It handles packet sequencing and maintains data
integrity.
29
TCP/IP: INTERNET LAYER
• The Internet layer corresponds to the OSI’s
Network layer, designating the protocols
relating to the logical transmission of packets
over the entire network.
• It takes care of the addressing of hosts by
giving them an IP (Internet Protocol) address
and handles the routing of packets among
multiple networks.
30
TCP/IP: NETWORK ACCESS LAYER
• At the bottom of the DoD model, the Network
Access layer implements the data exchange
between the host and the network.
• The equivalent of the Data Link and Physical
layers of the OSI model, the Network Access layer
oversees hardware addressing and defines
protocols for the physical transmission of data.
• The reason TCP/IP became so popular is because
there were no set physical layer specifications, so
it could run on any existing or future physical
network!
31
32
Some TCP/IP Protocols
33
Some of application layer
protocols and their functions
34
Simple Mail Transfer Protocol (SMTP)
• Governs the transmission of mail messages and
attachments
• SMTP is used in the case of outgoing messages
• More powerful protocols such as POP3 and
IMAP4 are needed and available to manage
incoming messages
• POP3(Post Office Protocol version 3) is the older
protocol
• IMAP4(Internet Mail Access Protocol version 4)
is the more advanced protocol
35
Telnet:
• It allows a user on a remote client machine, called
the Telnet client, to access the resources of another
machine, the Telnet server, in order to access a
command-line interface.
36
File Transfer Protocol (FTP)
• In order for a browser to display a web page, it must find the exact
server that has the right web page, plus the exact details that
identify the information requested.
• Your browser can understand what you need when you enter a
Uniform Resource Locator (URL), which we usually refer to as a web
address, e.g. http://www.lammle.com/forum and
http://www.lammle.com/blog.
47
Domain Name System (DNS)
www.wcu.edu.et 10.198.7.2
DNS Server
48
DNS cont’d…
• An IP address identifies hosts on a network
and the Internet as well, but DNS was
designed to make our lives easier.
• The IP address would change and no one
would know what the new one was.
• DNS allows you to use a domain name to
specify an IP address.
49
DNS cont’d…
• The very last section of the domain is called its top-
level domain (TLD) name
52
A lot of information a DHCP server can provide to
a host when the host is requesting an IP address
from the DHCP server.
Here’s a list of the most common types of
information a DHCP server can provide:
IP address
Subnet mask
Domain name
Default gateway (routers)
DNS server address
WINS server address
53
54
This is the four-step process a client takes to receive
an IP address from a DHCP server:
1. The DHCP client broadcasts a DHCP Discover
message looking for a DHCP server (Port 67).
2. The DHCP server that received the DHCP Discover
message sends a layer 2 unicast DHCP Offer
message back to the host.
3. The client then broadcasts to the server a DHCP
Request message asking for the offered IP address
and possibly other information.
4. The server finalizes the exchange with a unicast
DHCP Acknowledgment message.
Etc…. 55
Some of Transport layer protocols
and their functions
56
TCP(Transmission Control Protocol)
TCP: takes large blocks of information from an
application and breaks them into segments.
It numbers and sequences each segment to keep the
order the application intended.
After these segments are sent on the transmitting host,
TCP waits for an acknowledgment of the receiving end’s.
Retransmitting any segments that aren’t acknowledged.
It is Connection oriented means that a virtual
connection is established before any user data is
transferred.
57
TCP cont’d..
TCP can also recognize duplicate messages and
will discard them appropriately.
If the sending computer is transmitting too fast
for the receiving computer, TCP can employ
flow control mechanisms to slow data transfer.
TCP can also communicates delivery information
to the upper-layer protocols and applications it
supports.
All these characteristics makes TCP an end-to-
end reliable transport protocol.
58
TCP CONNECTION ESTABLISHMENT
59
TCP SEGMENT FORMAT
Below figure demonstrate how TCP segments a data
stream and prepares it for the Internet layer. When the
Internet layer receives the data stream, it routes the
segments as packets through an internetwork.
15-60
Some of fields in TCP segment
• Source port : This is the port number of the
application on the host sending the data.
• Destination port: This is the port number of the
application requested on the destination host.
• Sequence number: A number used by TCP that
puts the data back in the correct order or
retransmits missing or damaged data during a
process called sequencing.
• Acknowledgment number: The value is the TCP
octet that is expected next.
61
Cont’d…
Etc….
62
63
User Datagram Protocol (UDP)
• User Datagram Protocol (UDP)is basically the scaled-down
economy model of TCP, which is why UDP is sometimes
referred to as a thin protocol.
• Like a thin person , a thin protocol doesn’t take up a lot of
room—or in this case, require much bandwidth on a
network.
• UDP does not sequence the segments and does not care
about the order in which the segments arrive at the
destination.
• UDP just sends the segments off and forgets about them.
64
UDP cont’d…
67
68
69
Some of Internet or Network layer protocols
and their functions
70
Internet Protocol (IP) (Layer 3 protocol)
– Used for data communication in packet switched
network
– Unreliable and connectionless (no specific path)
– Unreliable
• Data corruption
• Packet lost
• Out of order
– Packet called Datagram
– internetworking computers
– Internet Protocol versions: IPv4, IPv6
71
IPv4
• Internet protocol version 4
• Uses 32 bit address.
• Possible addresses 2^32 = 4,294,967,296 (4.3 billion)
• Some addresses are reserved like private addresses plus multicast
addresses.
• Private addresses (LANs):
– 10.0.0.0 – 10.255.255.255
– 172.16.0.0 – 172.31.255.255
– 192.168.0.0 – 192.168.255.255
– Total reserved private addresses = 18 Million
• Multicast addresses:
– 224.0.0.0 – 239.255.255.255
– Total multicast addresses = 270 million
• Available addresses = possible addresses – (private addresses+
multicast addresses)
72
IP Addresses - Class A
• 32 bit global internet address
• Network part and host part
• Class A
– Start with binary 0
– All 0 reserved
– 01111111 (127) reserved for loopback
– Range 1.x.x.x to 126.x.x.x
– All allocated
73
IP Addresses - Class B
• Start 10
• Range 128.x.x.x to 191.x.x.x
• Second Octet also included in network address
• 214 = 16,384 class B addresses
• All allocated
74
IP Addresses - Class C
• Start 110
• Range 192.x.x.x to 223.x.x.x
• Second and third octet also part of network
address
• 221 = 2,097,152 addresses
• Nearly all allocated
– See IPv6
77
IPv6
• Increase in number of addresses
• 128 bits long address
• Represented in hexadecimal.
• Possible addresses 2^128
• 2^96 more address than IPv4
• ARP, RARP, IGMP are deleted or merged into
ICMPv6 protocol.
78
79
IP datagram format (cont.)
• Vers (4 bits): version of IP protocol (IPv4=4)
• Hlen (4 bits): Header length in 32 bit words, without options
(usual case) = 20
• Type of Service – TOS (8 bits): little used in past, now being
used for QoS
• Total length (16 bits): length of datagram in bytes, includes
header and data
• Time to live – TTL (8bits): specifies how long datagram is
allowed to remain in internet
– Routers decrement by 1
– When TTL = 0 router discards datagram
– Prevents infinite loops
• Protocol (8 bits): specifies the format of the data area
– Protocol numbers administered by central authority to guarantee
agreement, e.g. TCP=6, UDP=17 … 80
Cont’d…
• Source & destination IP address (32 bits each):
contain IP address of sender and intended
recipient.
• Options (variable length): Mainly used to record a
route, or timestamps, or specify routing.
• Identification: copied into fragment, allows destination
to know which fragments belong to which datagram
• Fragment Offset (12 bits): specifies the offset in the
original datagram of the data being carried in the
fragment
– Measured in units of 8 bytes starting at 0
• Flags (3 bits): control fragmentation
81
ARP Protocol (layer 3)
• Stands for address resolution protocol
• Finding physical address from logical address
• Host or router transmit IP datagram packet
containing logical address obtained from DNS.
• Query is broadcast but reply is uncast.
• Request contains sender and receiver IP plus
sender physical address.
• Reply contains physical address.
• Proxy ARP. (router sends its physical address)
82
Cont’d…
• ARP is used in four cases of two hosts communicating:
– When two hosts are on the same network and one desires to
send a packet to the other. (same network)
– When two hosts are on different networks and must use a
gateway/router to reach the other host (internet)
– When a router needs to forward a packet for one host through
another router. (internet)
– When a router needs to forward a packet from one host to the
destination host on the same network. (internet)
Reverse of ARP=RARP
• Finding logical address from physical address
• Request broadcast to network.
• Based on Client server protocol. 83
84
ICMP (Layer 3)
• Used to report errors with delivery of IP data.
• E.g. if particular service or host not reachable or to
check routers are correctly routing .
• Ping tool uses ICMP to check host is reachable and how
long it takes to reach.
• ICMP message is delivered in IP packet.
• Error reporting not error correction.
• Two types of messages
– Error reporting message
• Problems with router or host e.g. destination unreachable, time
exceeded, parameters problem
– Query message
• Help in getting specific information. e.g. neighbors 85
ICMP Errors
• Network Errors:
– Host or network unreachable
– Network congestion message:
• When router buffers too many packets, and don’t process
with same speed as received, generates source quench
message. Too many messages results congestion.
– Time exceed
• ICMP timeout message is generated when host is
unreachable.
• If errors in routing table, packets travel in loop. At each
router value is decremented by 1.
• When TTL value reaches to 0, packet discarded with ICMP
error.
• TTL value is default 86
87
IGMP Layer 3
• Internet group management protocol
• Protocol involved in multicasting.
• Protocol that manages group membership.
• Provides information to multicast routers about
the membership status of hosts.
• Router receives thousand of multicast packets, if
destination unreachable broadcast packets.
Increases traffic load.
• IGMP help router in providing this information.
-Agent maintains, edit membership and provide
information of group.
88
IGMP (contd….)
• IGMP has following messages
– Query
• Request for information of hosts
– Joining report
• If one process in group sends membership report.
– Leaving report
• When no other processes in company
89
Routing Protocols
93
94