27
Chapter 5 Introduction to OSI Reference Model 1 Chapter 5 Introduction to Open System Interconnection Reference Model Introduction The Open Systems Interconnection (OSI) model is a reference tool for understanding data communications between any two networked systems. It divides the communications processes into seven layers. Each layer both performs specific functions to support the layers above it and offers services to the layers below it. The three lowest layers focus on passing traffic through the network to an end system. The top four layers come into play in the end system to complete the process. We will provide you with an understanding of each of the seven layers, including their functions and their relationships to each other. This will provide you with an overview of the network process, which can then act as a framework for understanding the details of computer networking. Finally, this chapter will draw comparisons between the theoretical OSI model and the functional TCP/IP model. Although TCP/IP has been used for network communications before the adoption of the OSI model, it supports the same functions and features in a differently layered arrangement. A networking model offers a generic means to separate computer networking functions into multiple layers.

Chapter 5 1 Introduction to OSI Reference Model Chapter 5 ... · Chapter 5 4 Introduction to OSI Reference Model program to complete the communication process. Fig. 3 The "bottom

  • Upload
    others

  • View
    20

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Chapter 5 1 Introduction to OSI Reference Model Chapter 5 ... · Chapter 5 4 Introduction to OSI Reference Model program to complete the communication process. Fig. 3 The "bottom

Chapter 5 Introduction to OSI Reference Model

1

Chapter 5 Introduction to Open System

Interconnection Reference Model

Introduction

The Open Systems Interconnection (OSI) model is a reference tool for understanding data

communications between any two networked systems. It divides the communications processes into

seven layers. Each layer both performs specific functions to support the layers above it and offers

services to the layers below it. The three lowest layers focus on passing traffic through the network

to an end system. The top four layers come into play in the end system to complete the process.

We will provide you with an understanding of each of the seven layers, including their functions and

their relationships to each other. This will provide you with an overview of the network process,

which can then act as a framework for understanding the details of computer networking.

Finally, this chapter will draw comparisons between the theoretical OSI model and the functional

TCP/IP model.

Although TCP/IP has been used for network communications before the adoption of the OSI model,

it supports the same functions and features in a differently layered arrangement.

A networking model offers a generic means to separate computer networking functions into multiple

layers.

Page 2: Chapter 5 1 Introduction to OSI Reference Model Chapter 5 ... · Chapter 5 4 Introduction to OSI Reference Model program to complete the communication process. Fig. 3 The "bottom

Chapter 5 Introduction to OSI Reference Model

2

Each of these layers relies on the layers below it to provide supporting capabilities and performs

support to the layers above it. Such a model of layered functionality is also called a “protocol stack”

or “protocol suite”.

Protocols, or rules, can do their work in either hardware or software or, as with most protocol stacks,

in a combination of the two. The nature of these stacks is that the lower layers do their work in

hardware or firmware (software that runs on specific hardware chips) while the higher layers work

in software.

The Open System Interconnection model is a seven-layer structure that specifies the requirements

for communications between two computers. The ISO (International Organization for

Standardization) standard 7498-1 defined this model. This model allows all network elements to

operate together, no matter who created the protocols and what computer vendor supports them.

OSI Model Main Benefits

The main benefits of the OSI model include the following:

• Helps users understand the big picture of networking

• Helps users understand how hardware and software elements function together

• Makes troubleshooting easier by separating networks into manageable pieces

• Defines terms that networking professionals can use to compare basic functional

relationships on different networks

• Helps users understand new technologies as they are developed

• Aids in interpreting vendor explanations of product functionality

OSI Layer Repartition

The seven layers of the OSI reference model can be divided into two categories: upper layers and

lower layers as shown in Fig. 1.2.2.

The upper layers of the OSI model deal with application issues and generally are implemented only

in software. The highest layer, the application layer, is closest to the end user. Both users and

application layer processes interact with software applications that contain a communications

component. The term upper layer is sometimes used to refer to any layer above another layer in the

OSI model.

The lower layers of the OSI model handle data transport issues. The physical layer and the data link

layer are implemented in hardware and software. The lowest layer, the physical layer, is closest to

Page 3: Chapter 5 1 Introduction to OSI Reference Model Chapter 5 ... · Chapter 5 4 Introduction to OSI Reference Model program to complete the communication process. Fig. 3 The "bottom

Chapter 5 Introduction to OSI Reference Model

3

the physical network medium (the network cabling, for example) and is responsible for actually

placing information on the medium .

Fig.2: Two sets of layers make up the OSI layers

OSI Model and Communication between Systems

Information being transferred from a software application in one computer system to a software

application in another must pass through the OSI layers. For example, if a software application in

System A has information to transmit to a software application in System B, the application

program in System A will pass its information to the application layer (Layer 7) of System A. The

application layer then passes the information to the presentation layer (Layer 6), which relays the

data to the session layer (Layer 5), and so on down to the physical layer (Layer 1). At the physical

layer, the information is placed on the physical network medium and is sent across the medium to

System B. The physical layer of System B removes the information from the physical medium, and

then its physical layer passes the information up to the data link layer (Layer 2), which passes it to

the network layer (Layer 3), and so on, until it reaches the application layer (Layer 7) of System B.

Finally, the application layer of System B passes the information to the recipient application

Page 4: Chapter 5 1 Introduction to OSI Reference Model Chapter 5 ... · Chapter 5 4 Introduction to OSI Reference Model program to complete the communication process. Fig. 3 The "bottom

Chapter 5 Introduction to OSI Reference Model

4

program to complete the communication process.

Fig. 3 The "bottom up" communication process.

Interaction between OSI Model Layers

A given layer in the OSI model generally communicates with three other OSI layers:

the layer directly above it,

the layer directly below it,

its peer layer in other networked computer systems.

The data link layer in System A, for example, communicates with the network layer of System A,

the physical layer of System A, and the data link layer in System B. Fig. 4 illustrates this example.

Page 5: Chapter 5 1 Introduction to OSI Reference Model Chapter 5 ... · Chapter 5 4 Introduction to OSI Reference Model program to complete the communication process. Fig. 3 The "bottom

Chapter 5 Introduction to OSI Reference Model

5

Fig. 4 OSI Model Layers Communicate with Other Layers

Page 6: Chapter 5 1 Introduction to OSI Reference Model Chapter 5 ... · Chapter 5 4 Introduction to OSI Reference Model program to complete the communication process. Fig. 3 The "bottom

Chapter 5 (Cont.) Functions of the OSI Layers

6

Chapter 5

(Cont.)

Functions of the Open System

Interconnection Layers

In the following, we introduce the functions of each OSI layer.

Layer 1 – The Physical Layer

The physical layer of the OSI model defines connector and interface specifications, as well as the

medium (cable) requirements. Electrical, mechanical, functional, and procedural specifications are

provided for sending a bit stream on a computer network.

Layer 2 – The Data Link Layer

Layer 2 of the OSI model provides the following functions:

• Allows a device to access the network to send and receive messages

• Offers a physical address so a device’s data can be sent on the network

• Works with a device’s networking software when sending and receiving messages

• Provides error-detection capability

Page 7: Chapter 5 1 Introduction to OSI Reference Model Chapter 5 ... · Chapter 5 4 Introduction to OSI Reference Model program to complete the communication process. Fig. 3 The "bottom

Chapter 5 (Cont.) Functions of the OSI Layers

7

Common networking components that function at layer 2 include:

• Network interface cards

• Ethernet and Token Ring switches

• Bridges

NICs have a layer 2 or MAC address. A switch uses this address to filter and forward traffic, helping

relieve congestion and collisions on a network segment.

Layer 3 – The Network Layer

Layer 3 of the OSI model provides the following functions:

An end-to-end logical addressing system so that a packet of data can be routed

across several layer 2 networks (Ethernet, Token Ring, Frame Relay, etc.). Note

that network layer addresses can also be referred to as logical addresses.

Routers and other networked systems make routing decisions at the network

layer:

Page 8: Chapter 5 1 Introduction to OSI Reference Model Chapter 5 ... · Chapter 5 4 Introduction to OSI Reference Model program to complete the communication process. Fig. 3 The "bottom

Chapter 5 (Cont.) Functions of the OSI Layers

8

The Internet Protocol (IP) addresses make networks easier to both set up and connect with one

another. The Internet uses IP addressing to provide connectivity to millions of networks around the

world.

To make it easier to manage the network and control the flow of packets, many organizations

separate their network layer addressing into smaller parts known as subnets. Routers use the network

or subnet portion of the IP addressing to route traffic between different networks. Each router must

be configured specifically for the networks or subnets that will be connected to its interfaces.

Routers communicate with one another using routing protocols, such as Routing Information

Protocol (RIP) and Open version of Shortest Path First (OSPF), to learn of other networks that are

present and to calculate the best way to reach each network based on a variety of criteria (such as the

path with the fewest routers).

Routers and other networked systems make these routing decisions at the network layer.

The network layer accomplishes this via a process known as fragmentation.

When passing packets between different networks, it may become necessary to adjust their

outbound size to one that is compatible with the layer 2 protocol that is being used. The network

layer accomplishes this via a process known as fragmentation. A router’s network layer is usually

responsible for doing the fragmentation.

Diagnostics and Reports

All reassembly of fragmented packets happens at the network layer of the final destination system.

Two of the additional functions of the network layer are diagnostics and the reporting of logical

variations in normal network operation. While the network layer diagnostics may be initiated by any

networked system, the system discovering the variation reports it to the original sender of the packet

that is found to be outside normal network operation.

The variation reporting exception is content validation calculations. If the calculation done by the

receiving system does not match the value sent by the originating system, the receiver discards the

related packet with no report to the sender. Retransmission is left to a higher layer’s protocol.

Some basic security functionality can also be set up by filtering traffic using layer 3 addressing on

routers or other similar devices.

Layer 4 – The Transport Layer

Layer 4, the transport layer of the OSI model, offers end-to-end communication between end

devices through a network. Depending on the application, the transport layer either offers reliable,

connection-oriented or connectionless, best-effort communications.

Page 9: Chapter 5 1 Introduction to OSI Reference Model Chapter 5 ... · Chapter 5 4 Introduction to OSI Reference Model program to complete the communication process. Fig. 3 The "bottom

Chapter 5 (Cont.) Functions of the OSI Layers

9

Some of the functions offered by the transport layer include:

• Application identification

• Client-side entity identification

• Confirmation that the entire message arrived intact

• Segmentation of data for network transport

• Control of data flow to prevent memory overruns

• Establishment and maintenance of both ends of virtual circuits

• Transmission-error detection

• Realignment of segmented data in the correct order on the receiving side

• Multiplexing or sharing of multiple sessions over a single physical link

The most common transport layer protocols are the connection-oriented TCP transmission Control

Protocol (TCP) and the connectionless UDP User Datagram Protocol (UDP).

Layer 5 – The Session Layer

Layer 5, the session layer, provides various services, including tracking the number of bytes that

each end of the session has acknowledged receiving from the other end of the session. This session

layer allows applications functioning on devices to establish, manage, and terminate a dialog

through a network.

Session layer functionality includes:

• Virtual connection between application entities

Page 10: Chapter 5 1 Introduction to OSI Reference Model Chapter 5 ... · Chapter 5 4 Introduction to OSI Reference Model program to complete the communication process. Fig. 3 The "bottom

Chapter 5 (Cont.) Functions of the OSI Layers

10

• Synchronization of data flow

• Creation of dialog units

• Connection parameter negotiations

• Partitioning of services into functional groups

• Acknowledgements of data received during a session

• Retransmission of data if it is not received by a device

Layer 6 – The Presentation Layer

Layer 6, the presentation layer, is responsible for how an application formats the data to be sent out

onto the network. The presentation layer basically allows an application to read (or understand) the

message.

Examples of presentation layer functionality include:

• Encryption and decryption of a message for security

• Compression and expansion of a message so that it travels efficiently

• Graphics formatting

• Content translation

• System-specific translation

Layer 7 – The Application Layer

Layer 7, the application layer, provides an interface for the end user operating a device connected to

a network.

This layer is what the user sees, in terms of loading an application (such as Web browser or e-mail);

that is, this application layer is the data the user views while using these applications.

Examples of application layer functionality include:

Page 11: Chapter 5 1 Introduction to OSI Reference Model Chapter 5 ... · Chapter 5 4 Introduction to OSI Reference Model program to complete the communication process. Fig. 3 The "bottom

Chapter 5 (Cont.) Functions of the OSI Layers

11

• Support for file transfers

• Ability to print on a network

• Electronic mail

• Electronic messaging

• Browsing the World Wide Web

Page 12: Chapter 5 1 Introduction to OSI Reference Model Chapter 5 ... · Chapter 5 4 Introduction to OSI Reference Model program to complete the communication process. Fig. 3 The "bottom

Chapter 6 Introduction to Protocols

12

Chapter 6

Introduction to Protocols

What is a Network Protocol?

A protocol is a set of rules that governs the communications between computers on a network.

These rules include guidelines that regulate the following characteristics of a network:

access method,

allowed physical topologies,

types of cabling,

speed of data transfer.

Protocols define the format, timing, sequence, and error checking used on the network.

In other manner, to provide shared access to information and resources, LANs must deliver

information that is correct, in proper time sequential order, and understood by the recipient. To

accomplish these functions, electrical circuits, error detection systems, error correction systems,

information coding, data flow control, data formatting systems, and other hardware/software

subsystems must all perform in a cooperative fashion following a set of rules or "protocols".

Protocols can be implemented either in hardware or software or a mixture of both. Typically, the

lower layers are implemented in hardware, with the higher layers being implemented in software.

Protocols could be grouped into suites (or families, or stacks) by their technical functions, or origin

of the protocol introduction, or both. A protocol may belong to one or multiple protocol suites,

depending on how you categorize it. For example, the Gigabit Ethernet protocol IEEE 802.3z is a

LAN (Local Area Network) protocol and it can also be used in MAN (Metropolitan Area Network)

communications.

The OSI model provides a conceptual framework for communication between computers, but the

model itself is not a method of communication. Actual communication is made possible by using

communication protocols. 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. A protocol

implements the functions of one or more of the OSI layers.

A wide variety of communication protocols exist. Some of these protocols include LAN protocols,

Page 13: Chapter 5 1 Introduction to OSI Reference Model Chapter 5 ... · Chapter 5 4 Introduction to OSI Reference Model program to complete the communication process. Fig. 3 The "bottom

Chapter 6 Introduction to Protocols

13

WAN protocols, network protocols, and routing protocols. LAN protocols operate at the physical

and data link layers of the OSI model and define communication over various LAN media. WAN

protocols operate at the lowest three layers of the OSI model and define communication over the

various wide-area media. Routing protocols are network layer protocols that are responsible for

exchanging information between routers so that the routers can select the proper path for network

traffic. Finally, network protocols are the various upper-layer protocols that exist in a given protocol

suite. Many protocols rely on others for operation. For example, many routing protocols use network

protocols to exchange information between routers. This concept of building upon the layers already

in existence is the foundation of the OSI model.

Protocols and OSI model

The OSI model, and any other network communication model, provides only a conceptual

framework for communication between computers, but the model itself does not provide specific

methods of communication. Actual communication is defined by various communication protocols.

In modern protocol design, protocols are "layered" according to the OSI 7 layer model or a similar

layered model.

Layering is a design principle which divides the protocol design into a number of smaller parts, each

part accomplishing a particular sub-task and interacting with the other parts of the protocol only in a

small number of well-defined ways.

Layering benefits in networks

Layering allows the parts of a protocol to be designed and tested without a combinatorial

explosion of cases, keeping each design relatively simple.

Layering also permits familiar protocols to be adapted to unusual circumstances.

A multitude of different transport protocols are available on Windows, such as TCP, UDP, IPX, and

SPX. Each protocol behaves differently. Some require a connection to be established before sending

or receiving data. Others don't guarantee the reliability or integrity of the data.

Protocol Key Elements

A protocol defines what is communicated, how is it communicated and when is it communicated.

The key elements of a protocol are:

Syntax,

Semantics,

Page 14: Chapter 5 1 Introduction to OSI Reference Model Chapter 5 ... · Chapter 5 4 Introduction to OSI Reference Model program to complete the communication process. Fig. 3 The "bottom

Chapter 6 Introduction to Protocols

14

Timing.

Let's explain these elements:

Syntax

The term syntax refers to the structure or format of the data, meaning the order in which they are

presented.

Example:

A simple protocol might expect the first 8 bits of data to be the address of the sender , the second 8

bits to be the address of the receiver, and the rest of the stream to be the message itself.

Semantic

The term semantic refers to the meaning of each section of bits:

How a particular pattern to be interpreted,

What action is to be taken based on that interpretation?

Example:

Does an address identify the route to be taken or the final destination of a message?

Timing

The term timing refers to two characteristics:

When data should be sent,

How fast they can be sent.

Protocol Key

Elements

Syntax

Semantics

Timing

Page 15: Chapter 5 1 Introduction to OSI Reference Model Chapter 5 ... · Chapter 5 4 Introduction to OSI Reference Model program to complete the communication process. Fig. 3 The "bottom

Chapter 6 Introduction to Protocols

15

Example:

If a sender produces at 100 Mbps but the receiver can process data at only 1 Mbps, the transmission

will overload the receiver and some data will be lost.

Some Protocol Types

A protocol provides either connection-oriented services or connectionless services and can be

routable and non-routable. Let's see these types:

o Connection-Oriented protocols

In connection-oriented services, a path is established between the two communicating parties before

any data is exchanged. This ensures that there is a route between the two parties in addition to

ensuring that both parties are alive and responding. In addition, most connection-oriented protocols

guarantee delivery, which increases overhead as additional computations are performed to verify

correctness.

o Connectionless protocols

On the other hand, a connectionless protocol makes no guarantees that the recipient is listening. A

connectionless service is similar to the postal service: the sender addresses a letter to a particular

person and puts it in the mail. The sender doesn't know if the recipient is expecting to receive a letter

or if severe storms are preventing the post office from delivering the message.

Protocol Types

Connection-oriented

Routable

Connectionless

Non-routable

Page 16: Chapter 5 1 Introduction to OSI Reference Model Chapter 5 ... · Chapter 5 4 Introduction to OSI Reference Model program to complete the communication process. Fig. 3 The "bottom

Chapter 6 Introduction to Protocols

16

o Routable protocols

If a protocol is routable, a successful communication path can be set up (either a virtual connection-

oriented circuit or a data path for datagram communication) between two workstations, no matter

what network hardware lies between them. For example, machine A is on a separate network from

machine B. A router linking the two networks separates the two machines. A routable protocol

realizes that machine B is not on the same network as machine A; therefore, the protocol directs the

data to the router, which decides how to best forward it so that it reaches machine B.

Routable protocols, are communications protocol that contains a network address as well as a device

address. It allows packets [of information] to be forwarded from one network to another." This

means information can be routed anywhere -- it uses both an exterior and interior routing system to

transmit data.

Non-routable protocols

A non-routable protocol is not able to make such provisions; the router drops any packets of non-

routable protocols that it receives. The router does not forward a packet from a non-routable

protocol even if the packet's intended destination is on the connected subnet. NetBEUI is the only A

Three-Layer Model.

Non-routable protocols, which regulate the transfer of data, always use interior routing systems as a

way to transmit this data. A non-routable protocol is "a communications protocol that contains only

a device address and not a network address. It does not incorporate an addressing scheme for

sending data from one network to another." This means that these protocols are very specific about

where information can routed, and it must be within the interior network. Some people may find this

type of protocol very limited.

A three Layer Model

In very general terms, communications can be said to involve three agents:

applications,

computers,

networks.

One example of an application is a file transfer operation. These applications execute on computers

that can often support multiple simultaneous applications. Computers are connected to networks,

and the data to be exchanged are transferred by the network from one computer to another. Thus, the

transfer of data from one application to another involves first getting the data to the computer in

Page 17: Chapter 5 1 Introduction to OSI Reference Model Chapter 5 ... · Chapter 5 4 Introduction to OSI Reference Model program to complete the communication process. Fig. 3 The "bottom

Chapter 6 Introduction to Protocols

17

which the application resides and then getting it to the intended application within the computer.

With these concepts in mind, it appears natural to organize the communication task into three

relatively independent layers:

Network access layer

Transport layer

Application layer

Fig. 1 illustrates this simple architecture. Let's see these layers.

The network access layer

The network access layer is concerned with the exchange of data between a computer and the

network to which it is attached. The sending computer must provide the network with the address of

the destination computer, so that the network may route the data to the appropriate destination. The

sending computer may wish to invoke certain services, such as priority, that might be provided by

the network.

The specific software used at this layer depends on the type of network to be used; different

standards have been developed for circuit switching, packet switching, local area networks, and

others. Thus, it makes sense to separate those functions having to do with network access into a

Application

Transport

Network Access

Application

Transport

Network Access

Computer 1

Computer 2

Application Protocol

Transport Protocol

Network Access

Protocol Communication

Network

Fig. 1: Protocols in a simplified architecture

Page 18: Chapter 5 1 Introduction to OSI Reference Model Chapter 5 ... · Chapter 5 4 Introduction to OSI Reference Model program to complete the communication process. Fig. 3 The "bottom

Chapter 6 Introduction to Protocols

18

separate layer. By doing this, the remainder of the communications software, above the network

access layer, need not be concerned with the specifics of the network to be used. The same higher-

layer software should function properly regardless of the particular network to which the computer

is attached.

The transport layer

Regardless of the nature of the applications that are exchanging data, there is usually a requirement

that data be exchanged reliably. That is, we would like to be assured that all of the data arrive at the

destination application and that the data arrive in the same order in which they were sent. As we

shall see, the mechanisms for providing reliability are essentially independent of the nature of the

applications.

Thus, it makes sense to collect those mechanisms in a common layer shared by all applications; this

is referred to as the transport layer.

The application layer

Finally, the application layer contains the logic needed to support the various user applications. For

each different type of application, such as file transfer, a separate module is needed that is peculiar

to that application.

The following table summarizes the main functions of the three layers.

Table 1: The main functions of the three layers

Functions

Network

Layer

The network access layer is concerned with the exchange of data between a computer

and the network to which it is attached.

Transport

Layer

Assures that data be exchanged reliably. That is, we would like to be assured that all

of the data arrive at the destination application and that the data arrive in the same

order in which they were sent.

Application

Layer Contains the logic needed to support the various user applications.

Figure 2 illustrate this simple architecture. It shows three computers connected to a network:

Each computer contains software at the network access and transport layers and software at

Page 19: Chapter 5 1 Introduction to OSI Reference Model Chapter 5 ... · Chapter 5 4 Introduction to OSI Reference Model program to complete the communication process. Fig. 3 The "bottom

Chapter 6 Introduction to Protocols

19

the application layer for one or more applications.

Each computer on the network must have a unique network address; this allows the network

to deliver data to the proper computer.

Each application on a computer must have an address that is unique within that computer;

this allows the transport layer to support multiple applications at each computer.

Application

Transport

Network Access

Application

Transport

Network Access

Computer 1

Computer 2

Fig. 2: Protocol architectures and networks

Application

Transport

Network Access

Computer 3

Communications

Network

Network address

Service access point

Page 20: Chapter 5 1 Introduction to OSI Reference Model Chapter 5 ... · Chapter 5 4 Introduction to OSI Reference Model program to complete the communication process. Fig. 3 The "bottom

Chapter 6 (Cont.) TCP/IP

20

Chapter 6

(Cont.) Protocol Suite TCP/IP

The TCP/IP Protocol Suite

The main power of the Internet lies in two protocols:

the Transmission Control Protocol (TCP),

the Internet Protocol (IP).

Because of this, the Internet suite of protocols is referred to as the TCP/IP protocol suite (Fig. 1).

TCP is very close to the definition of transport layer of the OSI-RM. It provides a connection-

oriented delivery of data between two distributed applications in the Internet. TCP provides this

reliable service on the top of an unreliable IP.

IP is responsible for the routing and switching of datagrams through the Internet. We summarize

these functions in the following table.

Protocol Functions

TCP Provides a connection-oriented delivery of data between two distributed

applications in the Internet.

IP Responsible for the routing and switching of datagrams through the Internet.

Page 21: Chapter 5 1 Introduction to OSI Reference Model Chapter 5 ... · Chapter 5 4 Introduction to OSI Reference Model program to complete the communication process. Fig. 3 The "bottom

Chapter 6 (Cont.) TCP/IP

21

Fig.1: TCP/IP Suite

Here is a list of acronyms used in Figure 1:

FTP: File Transfer Protocol

HTTP: Hyper Text Transfer Protocol

SMTP: Simple Mail Transfer Protocol.

SNMP: Simple Network Management Protocol

TCP: Transmission Control Protocol

UDP: User Datagram Protocol

IP: Internet Protocol

ICMP: Internet Control Message Protocol

Page 22: Chapter 5 1 Introduction to OSI Reference Model Chapter 5 ... · Chapter 5 4 Introduction to OSI Reference Model program to complete the communication process. Fig. 3 The "bottom

Chapter 6 (Cont.) TCP/IP

22

A comparison between TCP and IP

In the following figure we compare the main characteristics between TCP and IP:

Fig.2: A comparison between TCP and IP

A standard practice is to show the protocol stack for the TCP/IP suite and compare it with the OSI-

RM. Such a stack is shown in the Figure 3.

TCP/IP Compared to the OSI Model

To compare TCP/IP to OSI model, we first give the two models as illustrated in figure 3.

IP

Connectionless

Unreliable Fast

+

TCP

Connection Oriented

Reliable Slow

+

Page 23: Chapter 5 1 Introduction to OSI Reference Model Chapter 5 ... · Chapter 5 4 Introduction to OSI Reference Model program to complete the communication process. Fig. 3 The "bottom

Chapter 6 (Cont.) TCP/IP

23

Application layer roughly corresponds to Session, Application, and Presentation layers of

OSI Model

Transport layer roughly corresponds to Transport layers of OSI Model

Internet layer is equivalent to Network layer of OSI Model

Network Interface layer roughly corresponds to Data Link and Physical layers of OSI Model

The Transmission Control Protocol (TCP)

TCP provides a connection-oriented, full-duplex, reliable, streamed delivery service using IP to

transport messages between two processes.

Reliability is ensured by:

• Connection-oriented service

• Flow control

• Error detection

• Error control

• Congestion avoidance algorithms;

The data part of the IP packet is the TCP packet. TCP takes care of the imperfections of IP and

protocols below IP. As mentioned earlier, the IP protocol may result in packets arriving out-of-

sequence at the destination. This is due to the possibility that each IP packet could be taking

different route to destination. TCP provides the capability of re-arranging the packets back in

sequence. IP packet may get lost and TCP would request a duplicate copy of the lost packet.

Besides, error checking in IP is provided only for the packet header. The TCP provides for the error

checking of the complete packet. If the reliability functions (in-sequence delivery, error checking

and congestion control) are embedded in IP, then the IP would become very reliable. However, the

data transfer rate will suffer because IP header is processed at every node. The TCP is an end-to-end

protocol and therefore is processed only at the sending and destination computers.

TCP is connection-oriented. This means that the protocols on two communicating computers set up

a connection before actual data transfer takes place. This is a very desirable property of TCP.

However, if the actual data message is short, then connection setting up and error checking adds too

much overhead. Besides, if the TCP at the receiving computer finds a packet in error, it requests the

TCP at the sending station to retransmit a copy of the packet. This is not a good error recovery

mechanism for delay sensitive applications. Due to these two inefficiencies of TCP, the Internet

protocol suite includes a connectionless protocol at the same level. It's called the user datagram

Page 24: Chapter 5 1 Introduction to OSI Reference Model Chapter 5 ... · Chapter 5 4 Introduction to OSI Reference Model program to complete the communication process. Fig. 3 The "bottom

Chapter 6 (Cont.) TCP/IP

24

protocol (UDP). UDP is a connectionless protocol and does not require the use of retransmission of

packets. However, the capability of error control is included as an option in UDP.

Used Addresses in TCP/IP

The used Addresses in TCP/IP are (Fig. 5):

Port address,

Internet address,

Physical address

The buffer size of these addresses is illustrated in the following table:

Buffer size

Port Address 16

Internet Address 32

Ethernet Address 48

Fig.5: Three types of addresses used in TCP/IP

User Process

TCP

IP

Ethernet Layer

Port Address

Internet Address

Physical Address

Page 25: Chapter 5 1 Introduction to OSI Reference Model Chapter 5 ... · Chapter 5 4 Introduction to OSI Reference Model program to complete the communication process. Fig. 3 The "bottom

Chapter 6 (Cont.) TCP/IP

25

Connection-oriented service

TCP performs data communication in full-duplex mode, that is both the sender and receiver

processes can send segments simultaneously. For connection establishment in full-duplex mode, a

four-way protocol can be used. However, the second and third steps can be combined to form a

three-way handshaking protocol.

Reliable Communication

To ensure reliability, TCP performs flow control, error control and congestion control.

Flow control:

TCP uses byte-oriented sliding window protocol, which allows efficient transmission of data and at

the same time the destination host is not overwhelmed with data. The receiver has a buffer size of 8

K bytes. After receiving 4 K bytes, the window size is reduced to 4 Kbytes. After receiving another

3 K bytes, the window size reduces to 1 K bytes. After the buffer gets empty by 4 K bytes, the

window size increases to 7 K bytes. So it may be noted that the window size is totally controlled by

the receiver window size, which can be increased or decreased dynamically by the destination. The

destination host can send acknowledgement any time.

Error Control:

Error control in TCP includes mechanism for detecting corrupted segments with the help of

checksum field. Acknowledgement method is used to confirm the receipt of uncorrupted data. If the

acknowledgement is not received before the time-out, it is assumed that the data or the

acknowledgement has been corrupted or lost. It may be noted that there is no negative

acknowledgement in TCP. To keep track of lost or discarded segments and to perform the

operations smoothly, the following four timers are used by TCP:

Retransmission; it is dynamically decided by the round trip delay time.

Persistence; this is used to deal with window size advertisement.

Kep-alive; commonly used in situations where there is long idle connection between

two processes

Time-waited; it is used during connection terminations

Congestion control:

To avoid congestion, the sender process uses two strategies known as slow-start and additive

increase, and the send one is known as multiplicative decrease. To start with, the congestion window

Page 26: Chapter 5 1 Introduction to OSI Reference Model Chapter 5 ... · Chapter 5 4 Introduction to OSI Reference Model program to complete the communication process. Fig. 3 The "bottom

Chapter 6 (Cont.) TCP/IP

26

size is set to the maximum segment size and for each segment that is acknowledged, the size of the

congestion window size is increased by maximum segment size until it reaches one-half of the

allowable window size. Ironically, this is known as slow-start, although the rate of increase is

exponential. After reaching the threshold, the window size is increased by one segment for each

acknowledgement. This continues till there is no time-out. When a time-out occurs, the threshold is

set to one-half of the last congestion window size.

TCP/IP Topology

The TCP/IP protocol suite can be used on stand-alone LANs and WANs or on complex

internetworks created by gluing many networks together. Figure 6 illustrates stand-alone network

links. Any hosts that are equipped with TCP/IP can communicate with one another across a LAN,

point-to-point line, or wide area packet network.

Networks are joined into an internetwork by means of IP routers. Figure 7 shows an internetwork

that was created by connecting the stand-alone networks together via IP routers.

Fig.6: Stand-alone networks.

Page 27: Chapter 5 1 Introduction to OSI Reference Model Chapter 5 ... · Chapter 5 4 Introduction to OSI Reference Model program to complete the communication process. Fig. 3 The "bottom

Chapter 6 (Cont.) TCP/IP

27

Fig. 7: Gluing networks together with routers.