CH 02
CH 02
2.1
2-1 LAYERED TASKS
2.2
Figure 2.1 Tasks involved in sending a letter
2.3
2-2 THE OSI MODEL
Established in 1947, the International Standards
Organization (ISO) is a multinational body dedicated to
worldwide agreement on international standards. An ISO
standard that covers all aspects of network
communications is the Open Systems Interconnection
(OSI) model. It was first introduced in the late 1970s. An
open system is a set of protocols that allows any two
systems to communicate regardless of their underlying
architecture. OSI model is not a protocol, it is a model of
understanding and designing a network architecture that
is flexible, robust and interoperable.
Topics discussed in this section:
Layered Architecture
Peer-to-Peer Processes
2.4Encapsulation
Note
2.6
Each layer defines a family of functions distinct from those of the other layers.
Within a single machine, each layer calls upon the services of the layer just
below
it. Layer 3, for example, uses the services provided by layer 2 and provides
services for layer 4.
The processes on each machine that communicate at a given layer are called
peer-to-peer processes.
2.7
Figure 2.3 The interaction between layers in the OSI model
2.8
At the physical layer, communication is direct: In Figure 2.3, device A
sends a stream of bits to device B (through intermediate nodes).
Each layer in the sending device adds its own information to the message it
receives from the layer just above it and passes the whole package to the
layer just below it.
2.9
Figure 2.3 The interaction between layers in the OSI model
2.10
Interfaces Between Layers
The passing of the data and network information down through the layers of
the sending device and back up through the layers of the receiving device is
made possible by an interface between each pair of adjacent layers.
Each interface defines the information and services a layer must provide for
the layer above it. Well-defined interfaces and layer functions provide
modularity to a network.
2.11
Figure 2.3 The interaction between layers in the OSI model
2.12
Organization of the Layers
The seven layers can be thought of as belonging to three subgroups. Layers I, 2, and
3-physical, data link, and network-are the network support layers; they deal with
the physical aspects of moving data from one device to another (such as electrical
specifications, physical connections, physical addressing, and transport timing and
reliability).
Layer 4, the transport layer, links the two subgroups and ensures
that what the lower layers have transmitted is in a form that the upper layers can use.
The upper OSI layers are almost always implemented in software; lower layers are a
combination of hardware and software, except for the physical layer, which is mostly
hardware.
Figure, which gives an overall view of the OSI layers, D7 means the data
unit at layer 7, D6 means the data unit at layer 6, and so on.
The process starts at layer 7 (the application layer), then moves from layer to layer in
descending, sequential order. At each layer, a header, or possibly a trailer, can be added to
2.13
the data unit.
Figure 2.4 An exchange using the OSI model
2.14
2-3 LAYERS IN THE OSI MODEL
2.15
Figure 2.5 Physical layer
2.16
Note
2.17
The physical layer is also concerned with the following:
o Physical characteristics of interfaces and medium. The physical layer defines the
characteristics of the interface between the devices and the transmission medium. It
also defines the type of transmission medium.
o Representation of bits. The physical layer data consists of a stream of bits (sequence
of Os or 1s) with no interpretation. To be transmitted, bits must be
encoded into signals--electrical or optical. The physical layer defines the type of
encoding (how Os and I s are changed to signals).
o Data rate. The transmission rate-the number of bits sent each second-is also defined
by the physical layer.
o Synchronization of bits. The sender and receiver not only must use the same bit rate
but also must be synchronized at the bit level. In other words, the sender and the
receiver clocks must be synchronized.
o Line configuration. The physical layer is concerned with the connection of devices to
the media. Point to point and Multi point
o Physical topology. The physical topology defines how devices are connected to make
a network.
2.18
Figure 2.6 Data link layer
2.19
Note
2.20
Other responsibilities of the data link layer include the following:
Framing. The data link layer divides the stream of bits received from the network
layer into manageable data units called frames.
o Error control. The data link layer adds reliability to the physical layer by adding
mechanisms to detect and retransmit damaged or lost frames. It also uses a mechanism
to recognize duplicate frames. Error control is normally achieved through a
trailer added to the end of the frame.
D Access control. When two or more devices are connected to the same link, data
link layer protocols are necessary to determine which device has control over the
link at any given time.
Figure 2.7 illustrates hop-to-hop (node-to-node) delivery by the data link layer.
2.21
Figure 2.7 Hop-to-hop delivery
2.22
Figure 2.8 Network layer
2.23
Note
2.24
Other responsibilities of the network layer include the following:
o Logical addressing. The physical addressing implemented by the data link layer
handles the addressing problem locally. If a packet passes the network boundary,
we need another addressing system to help distinguish the source and destination
systems. The network layer adds a header to the packet coming from the upper
layer that, among other things, includes the logical addresses of the sender and
receiver.
2.25
Figure 2.9 Source-to-destination delivery
2.26
Figure 2.10 Transport layer
2.27
Other responsibilities of the transport layer include the following:
o Service-point addressing. Computers often run several programs at the same time. For this
reason, source-to-destination delivery means delivery not only from one computer to the next
but also from a specific process (running program) on one computer to a specific process
(running program) on the other. The transport layer header must therefore include a type of
address called a service-point address (or port address). The network layer gets each packet to
the correct computer; the transport layer gets the entire message to the correct process on
that computer.
o Segmentation and reassembly. A message is divided into transmittable segments, with each
segment containing a sequence number. These numbers enable the transport layer to reassemble
the message correctly upon arriving at the destination and to identify and replace packets that
were lost in transmission.
o Connection control. The transport layer can be either connectionless or connection oriented.
A connectionless transport layer treats each segment as an independent packet and delivers it to
the transport layer at the destination machine. A connection oriented transport layer makes a
connection with the transport layer at the destination machine first before delivering the packets.
After all the data are transferred, the connection is terminated.
o Flow control. Like the data link layer, the transport layer is responsible for flow
control. However, flow control at this layer is performed end to end rather than
across a single link.
o Error control. Like the data link layer, the transport layer is responsible for error control.
However, error control at this layer is performed process-to process rather than across a single
link. The sending transport layer makes sure that the entire message arrives at the receiving
2.28
Note
2.29
Figure 2.11 Reliable process-to-process delivery of a message
2.30
Figure 2.12 Session layer
2.31
Note
2.32
Specific responsibilities of the session layer include the following:
o Dialog control. The session layer allows two systems to enter into a dialog. It allows the
communication between two processes to take place in either halfduplex (one way at a time) or
full-duplex (two ways at a time) mode.
2.33
Figure 2.13 Presentation layer
2.34
Note
2.35
Specific responsibilities of the presentation layer include the following:
o Translation. The processes (running programs) in two systems are usually exchanging
information in the form of character strings, numbers, and so on. The information must be
changed to bit streams before being transmitted. Because different computers use different
encoding systems, the presentation layer is responsible for interoperability between these
different encoding methods. The presentation layer at the sender changes the information from
its sender-dependent format into a common format. The presentation layer at the receiving
machine changes the common format into its receiver-dependent format.
2.36
Figure 2.14 Application layer
2.37
Note
2.38
Specific services provided by the application layer include the following:
o File transfer, access, and management. This application allows a user to access
files in a remote host (to make changes or read data), to retrieve files from a remote
computer for use in the local computer, and to manage or control files in a remote
computer locally.
o Mail services. This application provides the basis for e-mail forwarding and
storage.
o Directory services. This application provides distributed database sources and
access for global information about various objects and services.
2.39
Figure 2.15 Summary of layers
2.40
2-4 TCP/IP PROTOCOL SUITE
2.42
TCP/IP is a hierarchical protocol made up of interactive modules, each of which
provides a specific functionality; however, the modules are not necessarily interdependent.
Whereas the OSI model specifies which functions belong to each of its layers,
the layers of the TCP/IP protocol suite contain relatively independent protocols that
can be mixed and matched depending on the needs of the system. The term hierarchical
means that each upper-level protocol is supported by one or more lower-level
protocols.
Physical and Data Link Layers
At the physical and data link layers, TCPIIP does not define any specific protocol
Network Layer
At the network layer (or, more accurately, the internetwork layer), TCP/IP supports
the Internetworking Protocol. IP, in turn, uses four supporting protocols: ARP,
RARP, ICMP, and IGMP
Internetworking Protocol (IP)
The Internetworking Protocol (IP) is the transmission mechanism used by the TCP/IP
protocols. It is an unreliable and connectionless protocol-a best-effort delivery service.
The term best effort means that IP provides no error checking or tracking. IP assumes
the unreliability of the underlying layers and does its best to get a transmission through
to its destination, but with no guarantees.
IP transports data in packets called datagrams, each of which is transported separately.
Datagrams can travel along different routes and can arrive out of sequence or be
duplicated. IP does not keep track of the routes and has no facility for reordering datagrams
once they arrive at their destination.
2.43
Address Resolution Protocol
The Address Resolution Protocol (ARP) is used to associate a logical address with a
physical address. On a typical physical network, such as a LAN, each device on a link
is identified by a physical or station address, usually imprinted on the network interface
card (NIC). ARP is used to find the physical address of the node when its Internet
address is known
Reverse Address Resolution Protocol
The Reverse Address Resolution Protocol (RARP) allows a host to discover its Internet
address when it knows only its physical address. It is used when a computer is connected
to a network for the first time or when a diskless computer is booted
Internet Control Message Protocol
The Internet Control Message Protocol (ICMP) is a mechanism used by hosts and
gateways to send notification of datagram problems back to the sender. ICMP sends
query and error reporting messages
Internet Group Message Protocol
The Internet Group Message Protocol (IGMP) is used to facilitate the simultaneous
transmission of a message to a group of recipients
Transport Layer
Traditionally the transport layer was represented in TCP/IP by two protocols: TCP and
UDP. IP is a host-to-host protocol, meaning that it can deliver a packet from one
physical device to another. UDP and TCP are transport level protocols responsible
for delivery of a message from a process (running program) to another process. A new
2.44
transport layer protocol, SCTP, has been devised to meet the needs of some newer
User Datagram Protocol
The User Datagram Protocol (UDP) is the simpler of the two standard TCPIIP transport
protocols. It is a process-to-process protocol that adds only port addresses, checksum
error control, and length information to the data from the upper layer. UDP is discussed
in Chapter 23.
Transmission Control Protocol
The Transmission Control Protocol (TCP) provides full transport-layer services to
applications. TCP is a reliable stream transport protocol. The term stream, in this context,
means connection-oriented: A connection must be established between both ends
of a transmission before either can transmit data.
At the sending end of each transmission, TCP divides a stream of data into smaller
units called segments. Each segment includes a sequence number for reordering after
receipt, together with an acknowledgment number for the segments received. Segments
are carried across the internet inside of IP datagrams. At the receiving end, TCP collects
each datagram as it comes in and reorders the transmission based on sequence
Numbers
Stream Control Transmission Protocol
The Stream Control Transmission Protocol (SCTP) provides support for newer
applications such as voice over the Internet
Application Layer
The application layer in TCPIIP is equivalent to the combined session, presentation,
and application layers in the OSI modeL Many protocols are defined at this layer
2.45
2-3 TCP/IP PROTOCOL SUITE
TCP/IP
46
Protocol Suite
Figure 2.7 Layers in the TCP/IP Protocol Suite
TCP/IP
47
Protocol Suite
Figure 2.8 TCP/IP and OSI model
TCP/IP
48
Protocol Suite
Figure 2.10 Communication at the physical layer
A R1 R3 R4 B
Physical Physical
layer layer
Link 1 Link 3 Link 5 Link 6
TCP/IP
49
Protocol Suite
Note
TCP/IP
50
Protocol Suite
Figure 2.11 Communication at the data link layer
Physical Physical
Link 1 Link 3 Link 5 Link 6
D2 H2
Frame
D2 ame
Fr
H2
D2 H2 D2 H2
Frame Frame
TCP/IP
51
Protocol Suite
Note
TCP/IP
52
Protocol Suite
Figure 2.12 Communication at the network layer
Physical Physical
D3 H3
Datagram
D3 H3
Datagram
TCP/IP
53
Protocol Suite
Note
TCP/IP
54
Protocol Suite
Figure 2.13 Communication at transport layer
Physical Physical
D4 H4
Segment
D4 H4
Segment
TCP/IP
55
Protocol Suite
Note
TCP/IP
56
Protocol Suite
Figure 2.14 Communication at application layer
A B
Application Legend Source Destination D Data H Header Application
Transport Transport
R1 R3 R4
Network Network
Physical Physical
D5 D5
Message
D5 D5
TCP/IP
57 Message
Protocol Suite
Note
TCP/IP
58
Protocol Suite
2-5 ADDRESSING
2.59
Figure 2.17 Addresses in TCP/IP
2.60
Figure 2.18 Relationship of layers and addresses in TCP/IP
2.61
Physical address (MAC address):
- The physical address is the physical hardware device.
- This is specified by the manufacture company of the card.
- A hardware address that uniquely identifies each node of a network.
-The MAC layer interfaces directly with the network medium.
An example of a MAC-48 address would be
"00-08-74-4C-7F-1D".
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 ( : ) or ( - ),
as shown below:
Example 2.2
07:01:02:01:2C:4B
07-01-02-01-2C-4B
Logical address (IP):
•An IP address of the system is called logical address.
• This address is used by network layer to identify a particular network (source to
destination) among the networks.
•This address can be changed by changing the host position on the network. So it
2.62
is called logical address.
Port Address:
§ There are many application running on the computer.
§ Each application run with a port no.(logically) on the computer.
753
A 16-bit port address represented as one single number.
Specific Address:
- User-friendly addresses
- Examples include the e-mail address (for example, [email protected]) defines
the recipient of an e-mail
2.63
Example 2.1
2.64
Figure 2.19 Physical addresses
2.65
Example 2.2
07:01:02:01:2C:4B
2.66
Example 2.3
2.67
Figure 2.20 IP addresses
2.68
Example 2.4
2.69
Figure 2.21 Port addresses
2.70
Note
2.71
Example 2.5
753
2.72
Note
2.73
Data Flow and Encapsulation
Data flow occurs when two devices are connected in a network with some kind of shared
transmission medium.
1) An application running on the source device creates some kind of data. This happens
at the Application layer.
2) The application needs to add encryption to that data. This will be done at
the Presentation layer.
3) At the Session layer it appends the Session ID.
4) The Transport layer breaks the data into blocks of data which we call Segments .
Every Segment also gets the Port number to identify which upper layer application
needs to receive the data on the destination device
5) The Network layer takes the Segment, and appends the source and destination IP
address. At that point the Segment becomes a Packet.
6) At Data Link layer the source and destination MAC address and the CRC is added. At
this point we have a Frame.
7) The Frame then is sent to the physical device where it is translated into some kind of a
signal (often call it Bits)
2.74
Decapsulation at the Destination Device
1) The destination device receives series of bits and interprets them as a Frame.
2) It removes MAC addresses and the CRC, and passes the data up to the Network layer.
3) IP addresses are removed and the Packet is forwarded up to the Transport layer .
4) The Port number is looked at and the Segment gets forwarded up the to the appropriate
application specified by the Port number.
5) The Session ID is used.
6) Encryption will be removed.
7) The data in its original form is presented to the application that needs to interpret it.
2.75