Data communications and networking
1 / 52

Data Communications and Networking - PowerPoint PPT Presentation

  • Updated On :

Data Communications and Networking. Chapter 2 Protocol Architecture : TCP/IP model and OSI Model Reading: Book Chapter 2 Data and Computer Communications, 8th edition By William Stallings. Outline. Section 1: The need for a protocol architecture Section 2: TCP/IP protocol architecture

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
Download Presentation

PowerPoint Slideshow about 'Data Communications and Networking' - midori

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Data communications and networking

Data Communications and Networking

Chapter 2

Protocol Architecture:

TCP/IP model and OSI Model


Book Chapter 2

Data and Computer Communications, 8th edition

By William Stallings


  • Section 1: The need for a protocol architecture

  • Section 2: TCP/IP protocol architecture

  • Section 3: OSI model

  • Learning outcomes:

    • Describe the network protocol architectures and reference models

Section 1
Section 1

The Need for a Protocol Architecture

What is a protocol
What is a protocol?

  • From dictionary:

    • A general definition:

      the accepted or established code of procedure or behavior in any group, organization, or situation

    • For computing:

      set of rules governing the exchange or transmission of data electronically between devices


  • To perform a task, the involved parties usually follow a common protocol designed for this task

    • The protocol is just a set of rules or conventions

    • Different tasks use different protocols

  • Some key features of a protocol

    • Syntax

      • Concerns the format of the data blocks

    • Semantics

      • Includes control information for coordination and error handling

    • Timing

      • Includes speed matching and sequencing

Examples of protocol
Examples of Protocol

  • Two protocols will be studied in your first lab

    • HTTP is the protocol used for browsing website

      • Web browser <----> Web server


    • SMTP is the protocol used for sending emails

      • Email client software < ---- > SMTP server

  • A new application usually uses a new protocol, e.g. BitTorrent protocol:

  • TCP is a protocol used by Internet hosts for reliable data transmission

    • Recall that Internet packets could be lost inside the Internet

  • IEEE 802.11 is the protocol used in WiFi

    • How to coordinate a number of wireless devices within a WiFi network?

Need for protocol architecture
Need For Protocol Architecture

  • There are lots of network applications

  • Building each application from scratch is very time-consuming and challenging

    • What commands should be supported?

    • How to respond to each command?

    • How to identify the two peer applications?

      • Each computer may run multiple applications!

    • How to identify the two computers?

    • How to convert the data into bit stream?

    • How to convert the bit stream into signals?

    • How to detect and handle data loss and data error?

      • The network is not perfect!

    • Etc.


  • Most of the network apps share some common modules

Application A

Application B

Application C

Module A

Module B

Module C

Module T

Module T

Module T

Module I

Module I

Module I

Common modules

Module N

Module N

Module N

Module P

Module P

Module P


  • A complex task is broken into subtasks: modular design

    • Each subtask is implemented separately as a layer, arranged in a vertical stack

  • Each layer performs a related subset of the functions required to communicate with another system.

    • It relies on the next lower layer to perform more primitive functions and to conceal the details of those functions.

    • It provides services to the next higher layer.

    • Layers should be defined so that changes in one layer do not require changes in other layers.

  • So, instead of using a single complex protocol, it’s more flexible to implement a stack of protocols!

    • Reduce the design and development workload significantly!

Vertical stack

Application developers

Operating System


can be replaced by other modules

Module W

Vertical Stack

Application A

Application B

Application C

Module A

Module B

Module C

Module T

Module I

Module N

Module P


  • E.g., A can only speak Chinese, B can only speak Spanish, how can A communicate with B?

    • A finds a translator C, who can speak Chinese and English

    • B finds a translator D, who can speak Spanish and English

  • Two layers:

    • Higher layer: A and B

    • Lower layer: C and D

A two layer example
A Two-layer example

How to communicate?


Higher Layer


messages in Spanish

messages in Chinese

Lower Layer

messages in English



Lower layer provides services to the next higher layer.

Section 2
Section 2

TCP/IP Protocol Architecture

Protocol architecture
Protocol Architecture

  • Tasks of communicationsare broken up into modules

    • Each module (or layer) can have its own protocol

  • In very general terms, communications can be said to involve three components: applications, computers, and networks.

  • For example, file transfer could use three modules (or layers)

    • File transfer application

    • Communications service module

    • Network access module

  • The stack of protocols is called “Protocol Stack”

    • Or Protocol Architecture

Tcp ip protocol architecture
TCP/IP Protocol Architecture

  • Developed by the US Defense Advanced Research Project Agency (DARPA) for its packet switched network (ARPANET)

  • Used by the global Internet

  • It consists of a large collection of protocols that have been issued as Internet standard by the Internet Architecture Board (IAB).

    • Check

  • The TCP/IP protocol architecture organizes the communication task into five relatively independent layers:

    • Layer 5: Application layer

    • Layer 4: Transport layer, or Host to host (TCP belongs to this layer)

    • Layer 3: Internet layer, or Network layer (IP belongs to this layer)

    • Layer 2: Network access layer, or Link layer

    • Layer 1: Physical layer

  • Remark: Each layer can have lots of different protocols!


  • World Wide Web

    • Replies on the HTTP protocol

Web browser

Web server



Layer 5



Layer 4



Layer 3

IEEE 802.11

IEEE 802.3

Layer 2

IEEE 802.11g

IEEE 802.3 1000BASE-SX

Layer 1

Benefit of layering
Benefit of layering

  • The most challenging problem: how to provide a reliable data transfer service on top of an unreliable data network?

    • This problem is so important that today’s Operating Systems all provide such reliable service.

  • The burden of network application developers has been reduced significantly!

    • Hence the application developers can simply focus on the application layer issues.

    • We can easily develop thousands of network applications.

Physical layer
Physical Layer

  • The job of physical layer is to send individual bits from one node to a directly connected node.

    • Address the communications issue

  • The physical layer also covers the physical interface between a data transmission device (e.g., computer) and a transmission medium or network.

  • It is concerned with specifying characteristics of the transmission medium, the nature of the signals, the data rate, and related matters.

  • Examples:

    • Ethernet has many physical layer protocols: one for twisted-pair copper wire, another one for coaxial cable, some others for optical fiber, and so on.

    • IEEE 802.11b, 802.11a, 802.11g are different physical protocols for Wireless LAN, each with different transmission capabilities.

Network access layer



Network Access Layer

  • It is also called “Link layer”.

  • It solves the problem of exchanging data between two or more directly connected devices (computers, switches, routers, etc). The link layer packets are usually referred to as frames.

    • Point-to-point communications

    • Multiple access communications

  • The services provided by network access layer depend on the specific link-layer protocol that is employed over the link.

  • Issues to be addressed:

    • Reliability (error detection and error correction)

    • Priority (some data may be more important than others)

    • Addressing (for multiple access)

  • Examples of link layer protocols:

    • Point-to-point Protocol (PPP)

    • Ethernet: IEEE 802.3

    • Wireless LAN: IEEE 802.11

Internet layer ip
Internet Layer (IP)

  • IP layer is responsible for moving network layer packets known as datagrams from one host to another.

    • Main challenge: how to find a path from the source to the destination?

  • Two principal components:

    • IP protocol: defines the format of the datagram, and how the end systems and routers act on the datagram. []

    • Routing protocols: determine the routes that datagrams take between sources and destinations. The Internet uses many routing protocols.

  • The Internet layer routes a datagram through a series of packet switches called routers between source and destination.

Postal system
Postal System

To: Mr. Jacky Chan

No. 123, XX Road,


Inside postal system
Inside Postal System

Central Post Office (Beijing)

Central Post Office (New York)

The delivery of your package depends on the postal address.

Central Post Office (Hong Kong)

Local Post Office (Kowloon Tong)

Local Post Office (Tseung Kwan O)

What are the main functions of internet layer
What are the main functions of Internet layer?

  • Ultimate purpose: to provide a best-effort, connectionless, or datagram service between end systems

    • A host can send packets to any other host on the Internet

    • Best-effort: No guarantee of packet delivery. Packets could be lost, contain errors, or out-of-order.

  • How to achieve the purpose?

    • Addressing:

      • Every host needs to have a uniqueIP address

      • E.g., is the IP address of our cslinux1 server.

    • Networking

      • It’s not possible to connect any two hosts directly, therefore we need some “switches” to help. These “switches” are called IP Routers.

  • E.g., if host A wants to send a packet to host B:

    • If A and B are in the same network:

      • A can send the packet to B directly, without going through a router

    • If A and B are in different networks (very likely!):

      • Condition: A must be connected to a router R1, B must be connected to a router R2, R1 may not be connected to R2 directly, but R1 must be able to talk to R2 (through other routers)

      • A first sends the packet to R1

      • R1 helps to send the packet to R2 (this is a core part of the Internet layer) by checking the destination IP address (i.e., B’s IP address) contained in the IP packet

      • R2 sends the packet to B

Ip operation
IP Operation

LLC and MAC are sub-layers of Layer 2.

Ip address
IP Address

  • IPv4 address: 32-bit

  • Dotted decimal notation

    • <--> 11000000 00000101 00110000 00000011

  • Each IP packet includes the source IP address and the destination IP address

    • So that the routers know how to forward

  • Normally, we can think of a 32-bit IP address as having an network portion and local portion, where the network portion identifies a network, and the local portion identifies a host in that network.

    • E.g., in IP address

      • 158.182.7 identifies a network of COMP department

      • 15 identifies a PC in the network


  • Routers are responsible for receiving and forwarding packets through the interconnected set of networks.

    • Each router is connected with a number of other routers.

    • Routers use buffer to store the incoming packets.

    • Incoming packets could be dropped if the buffer is too full.

  • Each router makes routing decision based on a routing table.

    • Where to send out each IP packet?

    • Solution: make a search in the routing table based on the destination IP address

  • How to build up the routing table?

    • Static method: input by network administrators

    • Automatic method: by using routing protocols

      • Routers exchange routing information using a special routing protocol to build routing tables.

      • We will learn the principles of routing protocols in this subject.

Example of a routing table
Example of a Routing Table


Routing table at router A:











Transport layer
Transport Layer

  • How do software developers write network application programs?

    • They make use of the services provided by Transport Layer, which is normally part of the Operating System.

    • In fact, TCP/IP is indispensable for all the contemporary Operating Systems (even for small devices like PDA or smart phone!).

  • Transport layer transports application-layer messages between the client application and the server application.

    • Today’s multi-task computer can have a number of simultaneous applications. One task of Transport layer is to differentiate the data from/to different applications.

    • Another possible task of transport layer is to provide reliability.

      • Make the life of application developers much easier!

  • How does Transport layer send out the message?

    • Divide the message into packets

    • Use the Internet Layer to send out each packet

Overview of tcp and udp
Overview of TCP and UDP

  • Two most commonly used transport protocols: TCP and UDP

  • TCP:Transmission Control Protocol [ ]

    • connection-oriented

      • Temporary logical association between entities in different systems

    • Provides reliable data transmission service

    • Includes source and destination port numbers

      • Identify respective applications

      • A connection refers to a pair of ports

    • The data are organized into TCP segments

  • UDP: User Datagram Protocol [ ]

    • Lacks of reliability

      • No guaranteed data delivery

      • No preservation of sequence

      • No protection against duplication

    • With minimum overhead

    • Includes source and destination port

  • An Internet application needs to choose either TCP or UDP.


  • User Datagram Protocol

    • Defined in RFC 768


  • The UDP provides an unreliable connectionless delivery service using IP to transport messages between machines.

    • Because IP is unreliable

    • An application program the uses UDP needs to handle the problem of reliability, including message loss, duplication, delay, out-of-order delivery, etc.

Udp ports multiplexing and demultiplexing
UDP Ports: multiplexing and demultiplexing

  • Today’s operating systems support multi-processing, i.e., a number of applications can run simultaneously.

  • Multiplexing:

    • Each application program using UDP to send out data must first negotiate with the operating system to obtain a UDP port.

    • Any datagram the application program sends through the port will have that port number in its UDP packet.

  • Demultiplexing:

    • UDP accepts incoming datagrams from the IP module, and demultiplexes based on the UDP destination port.

Udp applications
UDP Applications

  • UDP’s advantages

    • Finer application-level control over what data is sent, and when

    • No connection establishment: saves time!

    • No connection state

    • Small packet header overhead: only 8 bytes

    • Can support multicast

  • Disadvantage: UDP is unreliable

  • Applications using UDP:

    • Streaming multimedia

    • Internet Telephony

    • Network management

    • Routing protocols

    • DNS


  • RFC 793


  • TCP provides reliable communication between pairs of processes (by using positive acknowledgement with retransmission).

    • No data loss, no error, no out-of-order (from the application’s point of view).

    • TCP uses the idea of retransmission to recover packet loss.

  • TCP is connection-oriented stream service.

    • From the hosts’ point of view, two applications need to “setup” a TCP connection (like virtual circuit) before they use TCP to exchange data.

      • But from the network’s point of view, they are still processing normal IP packets. Routers don’t distinguish between UDP packets and TCP packets.

    • TCP connection is full-duplex.

    • A TCP connection is recognized by (IPs, IPD, Ports, PortD, “TCP”)

    • TCP only supports point-to-point communication between TWO hosts. It cannot support multicast or broadcast which can be supported by UDP.

    • Data is regarded as byte stream. The TCP must deliver exactly the same sequence of bytes to the receiver application, though the IP packets may arrive out of order.

    • The stream is unstructured. There is no record boundaries.

Tcp ip concepts
TCP/IP Concepts

Tcp segment
TCP segment

  • A TCP application generates data as a byte stream.

  • TCP module receives some bytes from the byte stream, then composes a TCP segment by adding a TCP header, then sends the segment to IP module.

  • The size of TCP header is at least 20 octets.

    • TCP header can have some options.


  • TCP is the most complicated protocol in Internet. It is evolving all the time.

  • More than 90% of today’s Internet traffic are TCP. It has very wide applications.

  • You need to take another course to learn the details of TCP/IP:

    • COMP3040: Internet & the World Wide Web

Application layer
Application Layer

  • Contains the logic needed to support the user applications

  • Usually, each type of application needs to have one or more protocols.

  • E.g.

    • Email applications

      • Sending email -- smtp: []

      • Accessing email -- pop3: []

    • telnet

      • []

    • File transfer

      • FTP: File transfer protocol, []

    • Web application

      • HTTP/1.0: []

      • HTTP/1.1: []

    • P2P file sharing

      • Lots of different protocols, like BitTorrent, eDonkey

      • You can design and implement your own!

Addressing issue
Addressing Issue

  • “Address” is used to identify an object

    • It is common to use several addresses together to identify an object

  • Process level address: to identify a process

    • Port number (TCP/UDP)

  • Network level address: to identify a host

    • IP address (IP)

    • Unique IP address for each end system (computer) and router. A router has more than one IP addresses, each for a different interface.

  • Link level address: to identify a network card

    • Physical address (MAC address)

  • On Windows XP DOS prompt, type:

    • C:\>ipconfig /all

    • C:\>netstat -a

Trace of simple operation
Trace of Simple Operation

  • Process associated with port 1 in host A wants to send message to port 2 in host B

    • Process at A hands down message to TCP module, with instructions to send it to host B, port 2

    • TCP appends a TCP header, hands down to IP module to send to host B, with instructions to send it to host B

    • IP appends an IP header, hands down to network access layer (e.g. Ethernet) to send to router J, with instructions to send it to router J

    • Network access layer appends link header, sends out the bits to the connected router J through the network interface

    • At router J, the link header is stripped off and the IP header examined. From the IP header, router J knows that this packet is destined to host B, and actions accordingly.

Protocol data units pdus in tcp ip architecture
Protocol Data Units (PDUs) in TCP/IP Architecture

Section 3
Section 3

The OSI Model

Osi reference model
OSI Reference Model

  • OSI: Open Systems Interconnection

  • It was developed by the International Organization for Standardization (ISO), starting from 1977.

  • Seven layers later, OSI was published as ISO standard, ISO 7498, in 1984.

  • A theoretical system delivered too late!

  • TCP/IP has become the de facto standard for data communications.

Osi the model
OSI - The Model

  • A layer model

    • Each layer performs a related subset of the functions required to communicate with another system.

    • Each layer relies on the next lower layer to perform more primitive functions and to conceal the details of those functions.

    • Each layer provides services to the next higher layer.

    • Ideally, changes in one layer do not require changes in other layers.

  • The task of ISO was to define a set of layers and the services performed by each layer.

    • The partitioning should group functions logically and should have enough layers to make each layer manageably small, but should not have so many layers that the processing overhead is burdensome.

Osi layers
OSI Layers

Seven layers have been defined in OSI architecture.

Osi layers 1
OSI Layers (1)

  • Physical Layer

    • Physical interface between devices

      • Mechanical

      • Electrical

      • Functional

      • Procedural

  • Data Link Layer

    • Means of activating, maintaining and deactivating a reliable link

    • Error detection and control

    • Higher layers may assume error free transmission

Osi layers 2
OSI Layers (2)

  • Network Layer

    • Transport of information

    • Higher layers do not need to know about underlying technology

    • Not needed on direct links

  • Transport Layer

    • Exchange of data between end systems

    • Error free

    • In sequence

    • No losses

    • No duplicates

    • Quality of service

Network layer u se of a relay
Network layer: use of a Relay

Osi layers 3
OSI Layers (3)

  • Session Layer

    • Control of dialogues between applications

    • Dialogue discipline

    • Grouping

    • Recovery

  • Presentation Layer

    • Data formats and coding

    • Data compression

    • Encryption

  • Application Layer

    • Means for applications to access OSI environment

Key points

  • A protocol architecture is the layered structure of hardware and software that supports the exchange of data between systems and supports distributed applications, such as electronic mail and file transfer.

  • At each layer of a protocol architecture, one or more common protocols are implemented in communicating systems. Each protocol provides a set of rules for the exchange of data between systems.

  • The most widely used protocol architecture is the TCP/IP protocol suite, which consists of the following layers: physical, network access, internet, transport, and application.

  • Another important protocol architecture is the seven-layer Open Systems Interconnection (OSI) model.