2/15/2022
Chapter 2. LAYERED TASKS
Network Models We use the concept of layers in our daily
life. As an example, let us consider two
friends who communicate through postal
mail. The process of sending a letter to a
friend would be complex if there were no
services available from the post office.
1 2.2
Layered Tasks, Example THE OSI MODEL
Established in 1947, the International
Standards Organization (ISO) is a
multinational body dedicated to worldwide
agreement on international standards. An
ISO standard that covers all aspects of
network communications is the Open
Systems Interconnection (OSI) model. It was
first introduced in the late 1970s.
Note:
◦ ISO is the organization.
◦ OSI is the model.
2.3 2.4
1
2/15/2022
Seven layers of the OSI model Interfaces b/w Layers
2.5 2.6
Exchange using the OSI Model LAYERS IN THE OSI MODEL
Physical Layer
Data Link Layer
Network Layer
Transport Layer
Session Layer
Presentation Layer
Application Layer
2.7 2.8
2
2/15/2022
Physical Layer Data Link Layer
The physical layer is responsible for movements The data link layer is responsible for
of individual bits from one hop (node) to the moving frames from one hop (node) to
next. the next.
◦ Physical characteristics of interface and medium: pin
assignment, connector, cables ◦ Framing
◦ Representation of bits: encoding ◦ Physical addressing
◦ Data rate ◦ Flow control
◦ Synchronization of bits ◦ Error control
◦ Line configuration: point-to-point, multipoint ◦ Access control
◦ Physical topology
◦ Transmission mode: simplex, half-duplex, full-duplex
2.9 2.10
Hop-to-hop Delivery Network Layer
The network layer is responsible for the
delivery of individual packets from the
source host to the destination host.
◦ Logical addressing
◦ Routing
2.11 2.12
3
2/15/2022
Source-to-destination delivery Transport layer
The transport layer is responsible for the
delivery of a message from one process
to another.
◦ Service-point addressing
◦ Segmentation and reassembly
◦ Connection control
◦ Flow control
◦ Error control
2.13 2.14
Reliable process-to-process delivery
Segmentation and Reassembly
of a message
2.15 2.16
4
2/15/2022
Session layer Presentation layer
The session layer is responsible for dialog The presentation layer is responsible for
control and synchronization. translation, compression, and encryption.
2.17 2.18
Application layer Summary of layers
The application layer is responsible for
providing services to the user.
2.19 2.20
5
2/15/2022
TCP/IP and OSI model
TCP/IP PROTOCOL SUITE
The layers in the TCP/IP protocol suite do
not exactly match those in the OSI model.
The original TCP/IP protocol suite was
defined as having four layers: host-to-
network, internet, transport, and
application. However, when TCP/IP is
compared to OSI, we can say that the
TCP/IP protocol suite is made of five
layers: physical, data link, network,
transport, and application.
2.21 2.22
OSI and Protocol Stack OSI: Open Systems Interconnect
OSI Model TCP/IP Hierarchy Protocols ADDRESSING
7th
Application Layer
6th Four levels of addresses are used in an
Presentation Layer Application Layer
5th internet employing the TCP/IP protocols:
Session Layer
4th
Transport Layer
◦ Physical address
Transport Layer
3rd
Ex. Ehternet address, machine address
Network Layer
◦ Logical address
Network Layer
2nd
Link Layer
Link Layer IP address
1st
Physical Layer
◦ Port number
Link Layer : includes device driver and network interface
card ◦ Specific
Network Layer : handles the movement of packets, i.e. URL, Email address, domain name
Routing
Transport Layer : provides a reliable flow of data between
two hosts
Application Layer : handles the details of the particular 2.24
application
6
2/15/2022
Network layer in TCP/IP Transport layer in TCP/IP
Address resolution User Datagram Protocol (UDP)
Reverse address resolution ◦ Connectionless, unreliable
Internet control message Transmission Control Protocol (TCP)
Internet group message ◦ Connection-oriented, reliable
Stream Control Transmission Protocol
(SCTP)
◦ For supporting multimedia and VOIP
2.25 2.26
Relationship of layers and addresses
Example 2.1
in TCP/IP
In Figure 2.19 a node with physical
address 10 sends a frame to a node with
physical address 87. The two nodes are
connected by a link (bus topology LAN).
As the figure shows, the computer with
physical address 10 is the sender, and the
computer with physical address 87 is the
receiver.
2.27 2.28
7
2/15/2022
Physical addresses TCP/IP in a Network
The physical addresses will change from
hop to hop, data data
but the logical addresses usually remain
IP IP
the same. (1,2) (1,3)
1,2
1,2 data
data 1,3
1,3
NI NI
3487 6537
3487
data
6537
Intro to Computer Communication
2.29 ECE/IUPUI Networks 2-30
Example 2.2 Example 2.3
As we will see in Chapter 13, most local- Figure 2.20 shows a part of an internet with
area networks use a 48-bit (6-byte) two routers connecting three LANs. Each
physical address written as 12 device (computer or router) has a pair of
addresses (logical and physical) for each
hexadecimal digits; every byte (2 connection. In this case, each computer is
hexadecimal digits) is separated by a connected to only one link and therefore has
colon, as shown below: only one pair of addresses. Each router,
◦ 07:01:02:01:2C:4B however, is connected to three networks (only
two are shown in the figure). So each router has
three pairs of addresses, one for each
connection.
2.31 2.32
8
2/15/2022
IP addresses TCP/IP thru a Router
data data
Host A Router Host B
IP IP IP
(1,2) (1,1) (2,3) (2,5)
1,2 1,2
data 1,2 data
2,5 data 2,5
2,5
NI NI NI NI
3487 6543 1002 3903
3487 1002
data data
6543 3903
Intro to Computer Communication
2.33 ECE/IUPUI Networks 2-34
Example 2.4 Port addresses
Figure 2.21 shows two computers
communicating via the Internet. The sending
computer is running three processes at this
time with port addresses a, b, and c. The
receiving computer is running two processes at
this time with port addresses j and k. Process a
in the sending computer needs to communicate
with process j in the receiving computer. Note
that although physical addresses change from
hop to hop, logical and port addresses remain
the same from the source to destination.
2.35 2.36
9
2/15/2022
Example 2.5 Server in TCP/IP
A process waiting a packet on a specific port number
As we will see in Chapter 23, a port
Duplicate a connection after establishing
address is a 16-bit address represented by Connection?
◦ 5 tuple – (PT, SA, SP, DA, DP)
one decimal number. protocol type, source address, source port, destin address, destin port.
◦ A server waits on (pt, sa, sp, any-DA, any-DP)
◦ Upon a request from the client, any-DA and any-DP are filled with specific value.
Server Port Number – 0 to 1023 are reserved to well-known services.
Protocol Reserved Port # Comments
FTP 21 File Transfer
telnet 23 remote login
SMTP 25 E-mail
DNS 53 Domain name system
HTTP 80 World Wide Web
Intro to Computer Communication
2.37 ECE/IUPUI Networks 2-38
Berkeley Socket Example of Protocol
API – interface available to programmer Interaction between two peer entities
◦ socket(), bind(), listen(), accept(), connect(), sendto(), recvfrom(), Server/Client
htonl(), htons(), ntohl(), ntohs() ◦ Server – a process waiting a request
◦ Utility function - gethostbyname(), gethostbyaddr() Listening a specific port in TCP/IP
Httpd (Apache™) , telnetd, ftpd, …
Support multiple communication protocols ◦ Client – a process making a request
◦ Internet Domain A request to server address and the port number
◦ Unix Domain Netscape™, telnet, gftp, ws_ftp, …
◦ Xerox NS Domain (XNS) A connection in a server/client model is a 5-tuple
◦ ATM Domain (Recent progress in several implementation) ◦ Protocol type,
◦ Source address,
References
◦ Destination address
◦ Richard Stevens, “TCP/IP Programming”, or ◦ Source port number,
◦ http://en.wikipedia.org/wiki/Internet_socket ◦ destination port number
Intro to Computer Communication Intro to Computer Communication
ECE/IUPUI Networks 2-39 ECE/IUPUI Networks 2-40
10
2/15/2022
Example of Protocol, http (1) TCP and Socket in Client/Server
Host B (Server) Host A (Client)
Server Client
socket socket
bind
Listening on port 80 Request to 134.68.80.4:80
listen
accept (blocks)
connect (blocks)
Connection established
Connection established accept (returns)
read (blocks) connect returns
Send a request
GET/index.html HTTP 1.0 write
Send a result code read (blocks)
HTTP/1.1 200 read returns
write
Read and send the file
<html> <head> … Interpret and display the html
Disconnect the connection
time read returns
Intro to Computer Communication
ECE/IUPUI Networks 2-41 8-42
11