You are on page 1of 48

Multimedia Communications and Service on the Internet Lecture: 08 The OSI Model and the TCP/IP Protocol Suite

Course Conducted by Shuvodip Das, Lecturer, Department of ETE, Prime Unversity, Bangladesh.
1

OBJECTIVES:
To discuss the idea of multiple layering in data communication and networking and the interrelationship between layers. To discuss the OSI model and its layer architecture and to show the interface between the layers. To briefly discuss the functions of each layer in the OSI model. To introduce the TCP/IP protocol suite and compare its layers with the ones in the OSI model. To show the functionality of each layer in the TCP/IP protocol with some examples. To discuss the addressing mechanism used in some layers of the TCP/IP protocol suite for the delivery of a message from the source to the destination.
TCP/IP Protocol Suite

Chapter Outline

2.1 Protocol Layers 2.2 The OSI Model 2.3 TCP/IP Protocol Suite 2.4 Addressing

TCP/IP Protocol Suite

THE OSI MODEL


Established in 1947, the International Standards Organization (ISO) is a multinational body dedicated to worldwide agreement on international standards. Almost three-fourths of countries in the world are represented in the ISO. 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.

TCP/IP Protocol Suite

Topics Discussed in the Section

Layered Architecture Layer-to-layer Communication Encapsulation Layers in the OSI Model Summary of OSI Layers

TCP/IP Protocol Suite

Note

ISO is the organization; OSI is the model.

TCP/IP Protocol Suite

Figure 2.3 The OSI model

TCP/IP Protocol Suite

Figure 2.4 OSI layers

TCP/IP Protocol Suite

Figure 2.5 An exchange using the OSI model

TCP/IP Protocol Suite

OSI and Protocol Stack


OSI Model 7th Application Layer 6th Presentation Layer 5th Session Layer 4th Transport Layer 3rd Network Layer 2nd Link Layer 1st Physical Layer Link Layer Transport Layer Network Layer Application Layer TCP/IP Hierarchy Protocols

HTTP: Hypertext Transfer Protocol SMTP (Simple Mail Transfer Protocol) POP3 :(Post Office Protocol 3) FTP: File Transfer Protocol

UDP: User Datagram Protocol ICMP: Internet Control Message Protocol ARP: Address Resolution Protocol & RARP: Reverse ARP PPP: Point to Point Protocol

Packet Encapsulation
 The data is sent down the protocol stack  Each layer adds to the data by prepending headers

11

22Bytes20Bytes20Bytes 64 to 1500 Bytes

4Bytes

Ethernet
 Computer <-> Computer communication on same network  Each device has unique MAC address (48-bit) example: 00-C0-4F-48-47-93 Ethernet Packet:
Preamble Dest. Source address address
8bytes 6bytes 6bytes

12

Type

Data

CRC

2bytes

64 - 1500bytes

4bytes

MAC: Media Access Contr

ARP : Address Resolution Protocol


ARP provides mapping

13

32bit IP address <-> 48bit MAC address 128.97.89.153 <-> 00-C0-4F-48-47-93  ARP cache maintains the recent mappings from IP addresses to MAC addresses Protocol 1. ARP request broadcast on Ethernet 2. Destination host ARP layer responds Example: For example, the computers Matterhorn and Washington are in an office, connected to each other on the office local area network by Ethernet cables and network switches, with no intervening gateways or routers. Matterhorn knows that it wants to send a packet to Washington. Through other means, it determines that Washington's IP address is 192.168.0.55. In order to send the message, it also needs to know Washington's MAC address. First, Matterhorn uses a cached ARP table to look up 192.168.0.55 for any existing records of Washington's MAC address (00:eb:24:b2:05:ac). If the MAC address is found, it sends the IP packet on the link layer to address 00:eb:24:b2:05:ac via the local network cabling. If the cache did not produce a result for 192.168.0.55, Matterhorn has to send a broadcast ARP message (destination FF:FF:FF:FF:FF:FF) requesting an answer for 192.168.0.55. Washington responds with its MAC address (00:eb:24:b2:05:ac). Washington may insert an entry for Matterhorn into its own ARP table for future use. The response information is cached in Matterhorn's ARP table and the message can now be sent.

RARP (Reverse Address Resolution Protocol)




14

RARP (Reverse Address Resolution Protocol) is a protocol by which a physical machine in a local area network can request to learn its IP address from a gateway server's Address Resolution Protocol (ARP) table or cache. A network administrator creates a table in a local area network's gateway router that maps the physical machine (or Media Access Control - MAC address) addresses to corresponding Internet Protocol addresses. When a new machine is set up, its RARP client program requests from the RARP server on the router to be sent its IP address. Assuming that an entry has been set up in the router table, the RARP server will return the IP address to the machine which can store it for future use.

ICMP : Internet Control Message Protocol


 
            

15

Used to report problems with delivery of IP Datagrams within an IP network Used by Ping, Tracer out commands The Internet Control Message Protocol (ICMP) is one of the core protocols of the Internet Protocol Suite. It is chiefly used by the operating systems of networked computers to send error ICMP Message messages indicating, for example, that a requested service is 20bytes 4bytes not available or that a host or router could not be reached. ICMP can also be used to relay query messages. ICMP differs from transport protocols such as TCP and UDP in IP ICMP ICMP Header Header Data that it is not typically used to exchange data between systems, nor is it regularly employed by end-user network applications (with the exception of some diagnostic tools like ping and trace route). Type Code Checksum ICMP for Internet Protocol version 4 (IPv4) is also known as ICMPv4. IPv6 has a similar protocol, ICMPv6. 1byte 1byte 2bytes An example ICMP error message is the Time To Live Exceeded message. Every machine (such as an intermediate router) that forwards an IP datagram has to decrement the time to live (TTL) field of the IP header by one. If the TTL reaches 0, an ICMP Time to live exceeded in transit message is sent to the source of the datagram.

UDP (User Datagram Protocol )




16

With UDP, computer applications can send messages, in this case referred to as datagrams, to other hosts on an Internet Protocol (IP) network without requiring prior communications to set up special transmission channels or data paths. UDP uses a simple transmission model without implicit handshaking dialogues for providing reliability, ordering, or data integrity. Thus, UDP provides an unreliable service and datagrams may arrive out of order, appear duplicated, or go missing without notice. UDP assumes that error checking and correction is either not necessary or performed in the application, avoiding the overhead of such processing at the network interface level. Timesensitive applications often use UDP because dropping packets is preferable to waiting for delayed packets, which may not be an option in a real-time system. If error correction facilities are needed at the network interface level, an application may use the Transmission Control Protocol (TCP) or Stream Control Transmission Protocol (SCTP) which are designed for this purpose. UDP's stateless nature is also useful for servers answering small queries from huge numbers of clients. Unlike TCP, UDP is compatible with packet broadcast (sending to all on local network) and multicasting (send to all subscribers). Common network applications that use UDP include: the Domain Name System (DNS), streaming media applications such as IPTV, Voice over IP (VoIP), Trivial File Transfer Protocol (TFTP) and many online games.

Comparison of UDP and TCP




17

Transmission Control Protocol is a connection-oriented protocol, which means that it requires handshaking to set up end-to-end communications. Once a connection is set up user data may be sent bi-directionally over the connection. Reliable TCP manages message acknowledgment, retransmission and timeout. Multiple attempts to deliver the message are made. If it gets lost along the way, the server will re-request the lost part. In TCP, there's either no missing data, or, in case of multiple timeouts, the connection is dropped. Ordered if two messages are sent over a connection in sequence, the first message will reach the receiving application first. When data segments arrive in the wrong order, TCP buffers the out-of-order data until all data can be properly re-ordered and delivered to the application. Heavyweight TCP requires three packets to set up a socket connection, before any user data can be sent. TCP handles reliability and congestion control. Streaming Data is read as a byte stream, no distinguishing indications are transmitted to signal message (segment) boundaries.

Comparison of UDP and TCP




18

UDP is a simpler message-based connectionless protocol. Connectionless protocols do not set up a dedicated end-to-end connection. Communication is achieved by transmitting information in one direction from source to destination without verifying the readiness or state of the receiver. Unreliable When a message is sent, it cannot be known if it will reach its destination; it could get lost along the way. There is no concept of acknowledgment, retransmission or timeout. Not ordered If two messages are sent to the same recipient, the order in which they arrive cannot be predicted. Lightweight There is no ordering of messages, no tracking connections, etc. It is a small transport layer designed on top of IP. Datagrams Packets are sent individually and are checked for integrity only if they arrive. Packets have definite boundaries which are honored upon receipt, meaning a read operation at the receiver socket will yield an entire message as it was originally sent. No congestion control UDP itself does not avoid congestion, and it's possible for high bandwidth applications to trigger congestion collapse, unless they implement congestion control measures at the application level.

Note

The physical layer is responsible for moving individual bits from one (node) to the next.

TCP/IP Protocol Suite

19

Figure 2.6 Summary of OSI Layers

TCP/IP Protocol Suite

20

2-3 TCP/IP PROTOCOL SUITE


The TCP/IP protocol suite was developed prior to the OSI model. Therefore, the layers in the TCP/IP protocol suite do not match exactly with those in the OSI model. The original TCP/IP protocol suite was defined as four software layers built upon the hardware. Today, however, TCP/IP is thought of as a five-layer model with the layers named similarly to the ones in the OSI model. Figure 2.7 shows both configurations.

TCP/IP Protocol Suite

21

Topics Discussed in the Section

Comparison between OSI and TCP/IP Layers in the TCP/IP Suite

TCP/IP Protocol Suite

22

Figure 2.7 Layers in the TCP/IP Protocol Suite

TCP/IP Protocol Suite

23

Figure 2.8 TCP/IP and OSI model

TCP/IP Protocol Suite

24

Figure 2.9 A private internet

TCP/IP Protocol Suite

25

Figure 2.10 Communication at the physical layer

Legend

Source R3

Destination R4

A Physical layer
Link 1

R1

B Physical layer

Link 3

Link 5

Link 6

011 ... 101


0
1 1 .

. 1 0 1

011 ... 101

011 ... 101

TCP/IP Protocol Suite

26

Note

The unit of communication at the physical layer is a bit.

TCP/IP Protocol Suite

27

Figure 2.11 Communication at the data link layer

Legend

Source R1

Destination D Data R3 R4

H Header

A
Data link
Physical
Link 1

B
Data link
Physical

Link 3

Link 5

Link 6

D2 H2 Frame
D 2
r a

m
e

H 2

D2 H2 Frame

D2 H2 Frame

TCP/IP Protocol Suite

28

Note

The unit of communication at the data link layer is a frame.

TCP/IP Protocol Suite

29

Figure 2.12 Communication at the network layer


L g nd

Sou R1 R3

stin tion

HH d
R4

A
N two k t link

B
N two k t link

Physi l

Physi l

3 H3 t g

3 H3 t g

TCP/IP Protocol Suite

30

Note

The unit of communication at the network layer is a datagram.

TCP/IP Protocol Suite

31

Figure 2.13 Communication at transport layer


A
T p t
L g

S 1 3

ti ti

t 4 T p t

N tw

N tw

t li
P i l P

t li
i l

4 H4 S g t

4 H4 S g t

TCP/IP Protocol Suite

32

Note

The unit of communication at the transport layer is a segment, user datagram, or a packet, depending on the specific protocol used in this layer.

TCP/IP Protocol Suite

33

Figure 2.14 Communication at application layer


A
Appli ation
Legend

Source

Destination D Data H Header

Appli ation

sport t
t li

ransport t
t li

Physi l

Physi l

D5 D5 Message

TCP/IP Protocol Suite

D5 D5 Message

34

Note

The unit of communication at the application layer is a message.

TCP/IP Protocol Suite

35

2-4 ADDRESSING
Four levels of addresses are used in an internet employing the TCP/IP protocols: physical address, logical address, port address, and application-specific address. Each address is related to a one layer in the TCP/IP architecture, as shown in Figure 2.15.

TCP/IP Protocol Suite

36

Topics Discussed in the Section

 Physical Addresses  Logical Addresses  Port Addresses  Application-Specific Addresses

TCP/IP Protocol Suite

37

Figure 2.15 Addresses in the TCP/IP protocol suite

TCP/IP Protocol Suite

38

Example 2.3
In Figure 2.16 a node with physical address 10 sends a frame to a node with physical address 87. The two nodes are connected by a link (a LAN). At the data link layer, this frame contains physical (link) addresses in the header. These are the only addresses needed. The rest of the header contains other information needed at this level. As the figure shows, the computer with physical address 10 is the sender, and the computer with physical address 87 is the receiver. The data link layer at the sender receives data from an upper layer. It encapsulates the data in a frame. The frame is propagated through the LAN. Each station with a physical address other than 87 drops the frame because the destination address in the frame does not match its own physical address. The intended destination computer, however, finds a match between the destination address in the frame and its own physical address.

TCP/IP Protocol Suite

39

Figure 2.16 Example 2.3: physical addresses

87 10

Data

packet discarded

packet discarded
packet accepted

87 10

Data

2 4

TCP/IP Protocol Suite

40

Example 2.4
As we will see in Chapter 3, most local area networks use a 48-bit (6-byte) physical address written as 12 hexadecimal digits; every byte (2 hexadecimal digits) is separated by a colon, as shown below: 07:01:02:01:2C:4B A 6-byte (12 hexadecimal digits) physical address

TCP/IP Protocol Suite

41

Example 2.5
Figure 2.17 shows a part of an internet with two routers connecting three LANs. Each device (computer or router) has a pair of addresses (logical and physical) for each connection. In this case, each computer is connected to only one link and therefore has only one pair of addresses. Each router, however, is connected to three networks. So each router has three pairs of addresses, one for each connection. Although it may be obvious that each router must have a separate physical address for each connection, it may not be obvious why it needs a logical address for each connection. We discuss these issues in Chapters 11 and 12 when we discuss routing. The computer with logical address A and physical address 10 needs to send a packet to the computer with logical address P and physical address 95. We use letters to show the logical addresses and numbers for physical addresses, but note that both are actually numbers, as we will see in later chapters.
TCP/IP Protocol Suite

42

Figure 2.17 Example 2.5: logical addresses

20 10 A P Data

20 10 A P Data

33 99 A P Data
Physi al addresses changed

95 66 A P Data

95 66 A P Data
33 99 A P Data
Physi al addresses changed

TCP/IP Protocol Suite

43

Note

The physical addresses will change from hop to hop, but the logical addresses remain the same.

TCP/IP Protocol Suite

44

Example 2.6
Figure 2.18 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 both computers are using the same application, FTP, for example, the port addresses are different because one is a client program and the other is a server program.

TCP/IP Protocol Suite

45

Figure 2.18 Example 2.6: port numbers

Se

er

ece ver

Data a j
A P a j

Data

Data
Data

a j A P a j

Data Data

H2 A P a j

Data

H2 A P a j

Data

I er e
TCP/IP Protocol Suite

46

Note

The physical addresses change from hop to hop, but the logical and port addresses usually remain the same.

TCP/IP Protocol Suite

47

Example 2.7
As we will see in future chapters, a port address is a 16-bit address represented by one decimal number as shown.

753 A 16-bit port address represented as one single number

TCP/IP Protocol Suite

48

You might also like