03 Communication Networks
03 Communication Networks
Computer Networks
Chapter 2
Fall 2008 1
Agenda
• Protocol architecture
• The Layered network Model
• The OSI reference model
—Layers of OSI
• The TCP/IP model
—Layers of TCP/IP
• Comparison between OSI and TCP/IP
models
1
Protocol Architecture
2
Key Elements of a Protocol
• Syntax
—Data formats
—Signal levels
• Semantics
—Control information
—Error handling
• Timing
—Speed matching
—Sequencing
What’s a protocol?
human protocols: network protocols:
• “what’s the time?” • machines rather than
• “I have a question” humans
• introductions • all communication activity in
Internet governed by
protocols
… specific messages sent
… specific actions taken when
messages are received, or protocols define format,
other events order of messages sent and
received among network
entities, and actions taken
on message transmission,
receipt
3
What’s a protocol?
a human protocol and a computer network protocol:
Hi TCP connection
req.
Hi
TCP connection
Got the reply.
time?
5:00 Get http://www…./index.htm
time <file>
• It specifies
– Format of messages
– Meaning of messages
– Rules for exchange
– Procedures for handling problems
4
Protocol Specification
• As designers, we can specify a protocol using Space-
Time Diagrams
Space-Time Diagrams
5
Protocol Architecture
• Task of communication broken up into modules
11
12
6
Layered Communication
Location A
I like
Message
rabbits
L: Dutch Information
for the
Ik hou
Remote
van Translator
konijnen
Layered Communication
Location A Location B
I like J’aime
Message
rabbits les lapins
Fax #:---
Fax #:--- Information L: Dutch
L: Dutch for the Ik hou
Ik hou Remote
van
van Secretary
konijnen
konijnen
7
Layered Communication
Fax #:---
Fax #:--- Information L: Dutch
L: Dutch for the Ik hou
Ik hou remote
van secretary 1 van
konijnen
konijnen
16
8
A Three Layer Model
• In general, communications involve three
agents:
—Networks
—Computers
—Applications
• In this respect, communication tasks can be
organized in three independent layers:
Application
Transport
Network Access
17
18
9
Transport Layer
• Reliable data exchange
• Independent of network being used
• Independent of application
19
Application Layer
• Contains the logic to support different user
applications
• For each type of application, e.g. e-mail, file
transfer, a separate module is needed
20
10
Protocol Architectures and
Networks
21
Addressing Requirements
• Two levels of addressing required
—Each computer needs unique network address
—Each application on a (multi-tasking) computer needs
a unique address within the computer
• The Service Access Point (SAP)
• The port on TCP/IP stacks
22
11
Protocols in Simplified
Architecture
23
24
12
Protocol Data Units
25
Network PDU
• Adds network header
—network address for destination computer
• The network must know to which computer in the network
the data are to be delivered
—Facilities requests
• The network access protocol might want the network to
make use of certain facilities, such as priority
26
13
Operation of a Protocol
Architecture
27
Standardized Protocol
Architectures
• Required for devices to communicate
• Vendors have more marketable products
• Customers can insist on standards-based equipment
• As computers dropped in price, joining them together became very
popular – i.e. they were ‘Networked’ to share information.
• But how are they to talk to each other? If company A sold a
computer that cannot talk to company B’s computer, then life
becomes very difficult.
• What is needed is a standard – a set of rules that every company
will obey, so that their machines will know how to communicate.
• Two standards:
— OSI reference model
• Never lived up to early promises
— TCP/IP model
• Most widely used
28
14
Why is it important to have
standards for communicating?
29
30
15
The OSI layered model
• Open Systems Interconnection (OSI) was an effort to standardize
networking that was started in 1982 by the International Organization for
Standardization (ISO), along with the ITU-T.
• Prior to OSI, according to its proponents, networking was largely vendor-
developed and proprietary
• OSI was an industry effort, attempting to get everyone to agree to
common network standards to provide multi-vendor interoperability. It was
common for large networks to support multiple network protocol suites,
with many devices unable to talk to other devices because of a lack of
common protocols between them.
• However while OSI developed its networking standards, TCP/IP came into
widespread use as the de facto standard.
• The OSI reference model (which actually predates the OSI protocol
work, dating to 1977) was a major advance in the teaching of network
concepts. It promoted the idea of a common model of protocol layers,
defining interoperability between network devices and software.
31
32
16
OSI Layers
• 7 layers
7 Application
• There is no direct 6 Presentation
communication between peer
5 Session
layers except at the physical
layer 4 Transport
3 Network
• Above the physical layer, each
2 Data Link
protocol entity sends data
down to the next lower layer 1 Physical
to get data across to its peer
entity
OSI mnemonic
7 Application All
6 Presentation People
5 Session Seem
4 Transport To
3 Network Need
2 Data Link Data
1 Physical Processing
34
17
Other OSI mnemonics
“All Pretty Serious Teenagers Never Do Physics ”
or:
“Please Do Not Tell Sales People Anything ”
}
7 Application
6 Presentation Host layers: Provide
5 Session accurate data delivery between
computers
4 Transport
}
3 Network
2 Data Link Media layers: Control
physical delivery of messages
1 Physical over the network
36
18
Basic Rules in the OSI model
• Each layer can only talk to the one above it and
below it
— e.g. The ‘Network’ layer can only pass information to the
‘Transport’ layer above it and the ‘Data Link’ layer below it.
38
19
Layer 1: Physical layer
• The physical layer defines all the electrical and physical specifications for devices. In
particular, it defines the relationship between a device and a physical medium. This
includes the layout of pins, voltages and cable specifications. Hubs, repeaters,
network adapters and Host Bus Adapters are physical-layer devices.
• The physical layer is concerned primarily with the interaction of a single device with
a medium. The physical layer will tell one device how to transmit to the medium, and
another device how to receive from it, but not, with modern protocols, how to gain
access to the medium. Physical layer standards such as RS-232 use physical wires to
control access to the medium.
• The major functions and services performed by the physical layer are:
— Establishment and termination of a connection to a medium.
— Participation in the process whereby the communication resources are
effectively shared among multiple users. For example, floe control.
— Modulation, or conversion between the representation of digital data in user
equipment and the corresponding signals transmitted over a communications
channel. These are signals operating over the physical cabling (such as copper
and optical fiber) or over a radio link.
39
• Both WAN and LAN services arrange bits, from the physical layer, into
logical sequences called frames. Not all physical layer bits necessarily go
into frames, as some of these bits are purely intended for physical layer
functions. For example, every fifth bit of the FDDI bit stream is not used by
the data link layer.
40
20
Layer 2: Data Link layer (2/2)
• WAN Protocol Architecture
— Connection-oriented WAN data link protocols, in addition to framing, detect and
may correct errors. They also are capable of controlling the rate of transmission.
A WAN data link layer might implement a sliding window flow control and
acknowledgment mechanism to provide reliable delivery of frames.
• IEEE 802 LAN Architecture*
— Practical, connectionless LANs began with the pre-IEEE Ethernet specification,
which is the ancestor of the IEEE 802.3. This layer manages the interaction of
devices with a shared medium, which is the function of a Media Access Control
(MAC) sublayer. Above this MAC sublayer is the media-independent IEEE 802.2
Logical Link Control (LLC) sublayer, which deals with addressing and
multiplexing on multiaccess media.
• While IEEE 802.3 is the dominant wired LAN protocol and IEEE 802.11 the
wireless LAN protocol, obsolescent MAC layers include Token Ring and
FDDI. The MAC sublayer detects but does not correct errors.
• The Network layer performs network routing functions, and might also
perform fragmentation and reassembly, and report delivery errors.
42
21
Layer 4: Transport layer
• The Transport layer provides transparent transfer of data between end
users, providing reliable data transfer services to the upper layers.
44
22
Layer 6: Presentation layer
• The Presentation layer transforms the data to provide a standard interface
for the Application layer.
* Multipurpose Internet Mail Extensions (MIME) is an internet standard that extends the
format of email.
45
• Note that this layer provides services to user-defined application processes, and not
to the end user. For example, it defines a file transfer protocol, but the end user
must go through an application process to invoke file transfer. The OSI model does
not include human interfaces.
• The common application services sublayer provides functional elements including the
Remote Operations Service Element (comparable to Internet Remote Procedure
Call), Association Control, and Transaction Processing.
• Above the common application service sublayer are functions meaningful to user
application programs, such as messaging (X.400), directory (X.500), file transfer
(FTAM), etc.
46
23
James Bond and OSI analogy
• James Bond meets Number One on the 7th floor (application) of the spy headquarters
building. Number One gives Bond a secret message that must get through to the US
Embassy across town.
• Bond proceeds to the 6th floor (presentation) where the message is translated into an
intermediary language, encrypted and miniaturized.
• Bond takes the elevator to the 5th (session) floor where Security checks the message to
be sure it is all there and puts some checkpoints in the message so his counterpart at the
US end can be sure he’s got the whole message.
• On the 4th floor (transport) the message is analyzed to see if it can be combined with
some other small messages that need to go to the US end. Also if the message was very
large it might be broken into several small packages so other spies can take it and have it
reassembled on the other end.
• The 3rd floor (Network) personnel check the address on the message and determine
who the addressee is and advising Bond of the fastest route to the Embassy.
• On the 2nd floor (Data link) the message is put into a special courier pouch (packet). It
contains the message, the sender and destination ID. It also warns the recipient if other
pieces are still coming.
• Bond proceeds to the 1st floor (Physical) where Q has prepared the Aston Martin for the
trip to the Embassy. Bond departs for the US Embassy with the secret packet in hand.
• On the other end the process is reversed. Bond proceeds from floor to floor where the
message is decoded. The US Ambassador is very grateful the message got through safely.
"Bond, please tell Number One I’ll be glad to meet him for dinner tonight". 47
Peer-to-Peer Communications
Host A Host B
7 Application Application
Data
6 Presentation Presentation
5 Session Session
Segments
4 Transport Transport
Packets
3 Network Network
Frames
2 Data Link Data Link
Bits
1 Physical Physical
24
Data Encapsulation
Host A Host B
Application Application
Presentation
Session
Transport
Network
} Data
{ Presentation
Session
Transport
Network
Data Link Data Link
Physical Physical
Data Encapsulation
Host A Host B
Application Application
Presentation
Session
Transport
Network
} Network
Data
Data
{ Presentation
Session
Transport
Network
Header
Data Link Data Link
Physical Physical
25
Data Encapsulation
Host A Host B
Application Application
Presentation
Session
Transport
Network
} Network
Data
Data
{ Presentation
Session
Transport
Network
Header
Data Link Frame Network Data Frame Data Link
Header Header Trailer
Physical Physical
The packet from the network layer is then passed to the data
link layer where a frame header and a frame trailer are added
thus creating a data link frame.
Data Encapsulation
Host A Host B
Application Application
Presentation
Session
Transport
Network
} Network
Data
Data
{ Presentation
Session
Transport
Network
Header
Data Link Frame Network Data Frame Data Link
Header Header Trailer
Physical 1011110101001001 Physical
• Finally, the physical layer provides a service to the data link layer.
• This service includes encoding the data link frame into a pattern
of 1s and 0s for transmission on the medium (usually a wire).
26
Peer-to-Peer communication and
data encapsulation
Header Trailer
53
54
27
Layer Specific Standards
55
Elements of Standardization
• Protocol specification
— Operates between the same layer on two systems
— May involve different operating system
— Protocol specification must be precise
• Format of data units
• Semantics of all fields
• allowable sequence of PCUs
• Service definition
— Functional description of what is provided
• Addressing
— Each layer provides services to entities at the next higher layer.
These entities are referenced by means of SAPs
56
28
Service Primitives and
Parameters
• Services between adjacent layers expressed in
terms of primitives and parameters
• Primitives specify function to be performed
• Parameters pass data and control info
57
58
29
Timing Sequence for Service
Primitives
59
Use of a Relay
L3 L3
L2 L2
L1 L1
network node
e.g. router 60
30
Benefits of OSI model
• Any hardware that meets the OSI standard will be able to
communicate with any other hardware that also meets the
standard
• Any software that meets the OSI standard will be able to
communicate with any other hardware or software that also meets
the standard
• Consumers are given a wider choice since hardware/software from
any manufacturer will work together
• OSI is independent of country, it doesn't matter where the
hardware/software is made
• OSI is not dependent on the operating system used
• The protocols for OSI are defined at each stage
• Any errors that occur are handled in each layer
• The different layers can operate automatically
61
31
OSI modem summary
Data unit Layer Function
63
64
32
The TCP/IP model
• Developed by the US Defense Advanced Research Project Agency
(DARPA) for its packet switched network (ARPANET)
• Used by the global Internet
• No official model but a working one
• The TCP/IP model is a more accurate model of real-world
networking
TCP/IP Model
Application Layer
Transport Layer
Internet or Network Layer
Data Link Layer
Physical Layer 65
What is TCP/IP?
• TCP/IP is shorthand for a suite of protocols that run on top of IP.
— IP is the Internet Protocol, and TCP is the most important protocol that runs on
top of IP. Any application that can communicate over the Internet is using IP,
and these days most internal networks are also based on TCP/IP.
• Protocols that run on top of IP include:
— TCP, UDP and ICMP. Most TCP/IP implementations support all three of these
protocols.
• TCP/IP protocols work together to break data into packets that can be
routed efficiently by the network.
— In addition to the data, packets contain addressing, sequencing, and error
checking information. This allows TCP/IP to accurately reconstruct the data at
the other end.
• Analogy example of what TCP/IP does:
— Say you’re moving across the country: You pack your boxes and put your new
address on them.
— The moving company picks them up, makes a list of the boxes, and ships them
across the country using the most efficient route. That might even mean putting
different boxes on different trucks.
— When the boxes arrive at your new home, you check the list to make sure
everything has arrived (and in good shape), and then you unpack the boxes and
“reassemble” your house.
66
33
TCP/IP Physical Layer
• The Physical layer is responsible for encoding and transmission of
data over network communications media. It operates with data in
the form of bits that are sent from the Physical layer of the sending
(source) device and received at the Physical layer of the destination
device.
67
68
34
TCP/IP Internet (or Network) Layer
• This layer is responsible for getting data from the source network to
the destination network. This generally involves routing the packet
across a network of networks, known as an internetwork or (lower-
case) internet.
• All routing protocols, such as OSPF, and RIP are also part of the
network layer. What makes them part of the network layer is that
their payload is totally concerned with management of the network
layer.
69
• The transport layer provides this service of connecting applications together through
the use of ports. Since IP provides only a best effort delivery, the transport layer is
the first layer of the TCP/IP stack to offer reliability.
70
35
TCP/IP Transport Layer (2/2)
• The Stream Control Transmission Protocol (SCTP) is also a "reliable", connection-oriented,
transport mechanism. It is stream-oriented — not byte-oriented like TCP — and provides multiple
streams multiplexed over a single connection. It also provides multi-homing support, in which a
connection end can be represented by multiple IP addresses (representing multiple physical
interfaces), such that if one fails, the connection is not interrupted. It was developed initially for
telephony applications (to transport SS7 signalling over IP), but can also be used for other
applications.
• User Datagram Protocol (UDP) is a connectionless datagram protocol. Like IP, it is a best
effort or "unreliable" protocol. Reliability is addressed through error detection using a weak
checksum algorithm. UDP is typically used for applications such as streaming media (audio and
video, etc) where on-time arrival is more important than reliability, or for simple query/response
applications like DNS lookups, where the overhead of setting up a reliable connection is
disproportionately large.
• Both TCP and UDP are used to carry a number of higher-level applications. The applications at
any given network address are distinguished by their TCP or UDP port.
• The Real-time Transport Protocol (RTP) is a datagram protocol that is designed for real-time
data such as streaming audio and video.
71
• Data sent over the network is passed into the application layer
where it is encapsulated into the application layer protocol. From
there, the data is passed down into the transport layer.
36
TCP protocol
• TCP stands for Transmission Control Protocol.
• TCP establishes a reliable connection between two applications over the network
(connection-oriented). This means that TCP guarantees accurate, sequential delivery
of your data. If something goes wrong, TCP reports an error, so you always know
whether your data arrived at the other end.
UDP protocol
• Alternative to TCP is the User Datagram Protocol
• UDP is a fast, unreliable, connectionless protocol, that is suitable for
some applications.
• Unreliable means there is no sequencing, no guaranteed delivery
(no automatic retransmission of lost packets) and sometimes no
checksums.
• Fast means there is no connection setup time, unlike TCP. In
reality, once a TCP session is established, packets will go just as
fast over a TCP connection as over UDP.
• UDP is useful for applications such as streaming audio that don’t
care about dropped packets and for applications such as TFTP that
inherently do their own sequencing and checksums. Also,
applications such as NFS that usually run on very reliable physical
networks and which need fast, connectionless transactions use
UDP.
74
37
TCP/IP Concepts
75
Addressing level
• Level in architecture at which entity is named
• Unique address for each end system (computer)
and router
• Network level address
—IP or internet address (TCP/IP)
—Network service access point or NSAP (OSI)
• Process within the system
—Port number (TCP/IP)
—Service access point or SAP (OSI)
76
38
Trace of Simple Operation
• Process associated with port 1 in host A sends
message to port 2 in host B
• Process at A hands down message to TCP to
send to port 2
• TCP hands down to IP to send to host B
• IP hands down to network layer (e.g. Ethernet)
to send to router J
• Generates a set of encapsulated protocol data
units (PDUs)
77
PDUs in TCP/IP
78
39
Example of Header Information
in TCP segment
• Destination port
— When the TCP entity at B receives the segment, it must know to
whom the data are to be delivered
• Sequence number
— TCP numbers the segments that it sends to a particular
destination port sequentially, so if they arrive out of order, the
TCP entity at B can reorder them
• Checksum
— The sending TCP includes a code which is a function of its
contents. The receiving TCP performs the same calculation and
compares the result with the incoming code. If there is a
discrepancy, then it implies that there has been an error in
transmission.
79
80
40
Mapping examples of Real-World
protocols to OSI model
82
41
Comparison between OSI and
TCP/IP models (1/3)
83
TCP model
• the protocols came first, the model was just a
description of the protocols
• the model isn't good for any other protocols part from
TCP/IP.
84
42
Comparison between OSI and
TCP/IP models (3/3)
A critique of OSI model:
• Bad Timing
- TCP already in use by the time OSI came along.
• Bad Technology
- Layers don't match reality. Chosen because IBM's SNA has
seven layers.
- Dominated by phone company mentality.
• Bad Implementation
- Huge, unwieldy, slow.
85
Required Reading
• W. Stallings, “Data and Computer Communications (7th
edition)”, Prentice Hall, Chapter 2
• www.wikipedia.org
86
43