This document provides an overview of computer networks, the OSI model, TCP/IP model, and related protocols. It discusses:
- The 7 layers of the OSI model and the functions of each layer.
- How packets are encapsulated as they pass through each layer of the OSI model.
- Similarities and differences between the OSI model and TCP/IP model.
- Key protocols associated with each layer including TCP, UDP, IP, ICMP, ARP/RARP.
- Concepts such as addressing schemes, encapsulation, connection establishment and termination.
The document uses diagrams and explanations to concisely describe the layers, protocols, and fundamental concepts relating to computer network models and
1. Computer Networks
OSI Model and Protocols
Date:
Department of Computer Engineering
Presented By:
Rubal Sagwal
NIT, Kurukshetra
Department of Computer Engineering
1ADAD
2. Contents
• Introduction to Layers and Protocols.
• OSI Model
• OSI Model layer functioning.
• TCP/IP Model
• Addressing scheme
ADAD 2
6. OSI Model
• Open System Interconnection.
• Firstly introduced in 1970s.
• An open system is a set of protocols that allow any two
different systems to communicate.
• Protocols: Set of rules.
• OSI model itself is not a protocol, it is a model that
define protocols for network communication.
• Seven separate but related layers.
ADAD 6
8. Encapsulation
• A packet (header and data) at level 7 is
encapsulated in a packet at level 6.
• The whole packet at level 6 is encapsulated in a
packet at level 5 and so on.
ADAD 8
10. Organization of Layers
• 7 layers can be thought of belonging to three
subgroup.
• These are:
ADAD 10
Layer 1
• Physical
• Data link
• Network
Layer 2
• Transport
layer
Layer 3
• Session
• Presentation
• Application
11. 1. Physical Layer
Physical characteristics of interfaces and medium:
Define physical transmission medium (Guided or Unguided).
Interface between devices and transmission medium.
Representation of bits:
PL consist of bits (0s and 1s), so, data -> bits ->signals
(electrical or optical).
Data rate
Transmission rate (means the number of bits sent per
second).
Synchronization of bits:
Sender and receiver must not receive the same bit rate but
must be at same time (synchronized clock0.
ADAD 11
12. 1. Physical Layer
Line configuration:
Connection (point-to-point or multipoint) of devices to
the medium.
Physical topology:
Topological Structure (Bus, Star, Mesh etc)
Transmission mode:
Simplex, half-duplex or full duplex.
ADAD 12
13. 2. Data Link Layer
Framing:
Arranging bit streams into Data Frames.
Physical addressing (machine address):
Add header to the frame to define the sender and receiver of
the data packet.
Flow Control;
Not to overload receiver
Error Control:
Error Free
Access Control:
Which device has access to the link at specific time instance.
ADAD 13
15. 4. Transport Layer
Process-to-process delivery (applications)
Service-point addressing:
Send data to the correct process on particular computer.
Segmentation and reassembly
Divide into segments and assign sequence number.
Reassembly at destination according to sequence number.
Connection control
Connectionless or connection oriented
Flow control
Error control
Without damage, loss or duplication
ADAD 15
16. 5. Session Layer
It establish, maintains and synchronize the
interaction among communicating systems.
Dialog control (half-duplex or full duplex at
application level)
Synchronization
ADAD 16
17. 6. Presentation Layer
Semantics and Syntax
Translation:
Change the format according receivers end.
Encryption and Decryption
Compression
Reduce the size (Video, audio, images etc)
ADAD 17
18. 7. Application Layer
User Interface
File transfer, access and management
Mail services
Directory service (database)
ADAD 18
22. TCP/IP Layer Functioning
• PHYSICAL LAYER: Doesn’t define any specific
protocol, define physical structure.
• NETWORK LAYER: Supports internetworking
protocol (ARP, RARP, ICMP and IGMP).
• TRANSPORT LAYER: Responsible for delivery of
message from a process to another process (TCP
and UDP).
• APPLICATION LAYER: Is a combination of Session,
Presentation and Application Layer of OSI Model.
ADAD 22
24. Relationship of layers and Addresses in TCP/IP
ADAD 24
• SPECIFIC ADDRESS
• (Processes)
Application
Layer
• PORT ADDRESS
• (SCTP, TCP, UDP)Transport Layer
• LOGICAL ADDRESS
• (IP and other protocols)Network Layer
• PHYSIAL ADDRESS
• (Underlying physical Networks)
Host-to-
network
25. Physical Address
• Address of a node as defined by LAN or WAN.
• Included in the frame used by DLL (Data link layer).
• Address format depends upon network.
ADAD 25
26. Logical Address
• IP Address.
• Used for Universal Communication.
• Identify each host uniquely in a network.
• Currently is 32 bit address.
ADAD 26
27. Port Address
• Process Address.
• For example: Computer A can communicate with computer
B by using TALNET. At the same time A can communicate
with C using File transfer Protocol. For these process to
receive data simultaneously we need method to label the
process, i.e Port Address.
ADAD 27
31. Delivery Process
1. Node-to-Node Delivery: The Data link layer is responsible
for delivery of frames between two neighboring nodes
over a link, called node-to-node delivery.
2. Host-to-Host: Network layer is responsible for delivery of
datagrams between two hosts.
3. Process-to-Process: Transport layer is responsible for
delivery of data from process-to-process (application
program).
ADAD 31
32. Connectionless Vs Connection Oriented
Connectionless
• For sending data from
source to destination, no
need to establish any
connection.
• Packets are not
numbered; they may be
delayed or lost may
arrive out of sequence.
• No acknowledgement.
• Ex: UDP
Connection Oriented
• Connection is first
established between the
sender and the receiver.
• Data are transferred.
• Connection is released.
• Ex: TCP and SCTP.
ADAD 32
33. UDP
• User Datagram Protocol.
• Connectionless Protocol and Unreliable (No flow and error
control).
• Then why are we using it?
• Very simple protocol.
• If a process wants to send a small message and does not care much
about reliability.
• For small message (no need to generate any connection).
• Multicasting
ADAD 33
34. Well known port used by UDP
• Command for Unix:
$grep ftp /etc/services
ftp 21/udp
ADAD 34
Port Protocol Description
7 Echo Print a received datagram back to sender.
9 Discard Discards any datagram that is received.
11 User Active user.
13 Daytime Returns the date and time
53 Nameserver Domain Name Service
35. User datagram of UDP
• UDP packets called User Datagrams, have fixed size header of 8
bytes. Fields are as follows:
1. Source Port Number: Used by process running on the source
host.
• 16 bit long (range from 0 to 216 = 65535)
2. Destination Port Number: used by the process running on
destination host.
• 16 bit long.
3. Length: 16-bit long (0 to 65535).
• Define the length of user datagram header plus data.
UDP datagram length field is not that much important because it is
encapsulated within IP packet.
4. Checksum: for detection of error.
ADAD 35
36. Operation of UDP
• Connectionless Services: it means each datagram sent by
UDP is independent datagram.
• There is no relationship between the different user datagram even
if they are coming from same source process or going to same
destination.
• Are not numbered (nothing common).
• No connection establishment, no termination.
• Can’t send stream of data and chop them into different related
datagrams.
• Only for short messages that can fit into one datagram.
• Flow and Error Control: Very simple and unreliable.
• No flow control hence no windows, can overflow.
• Sender doesn’t know message has lost or duplicate, except a small
checksum that is not enough.
• Encapsulation and Decapsulation: within IP datagram.
ADAD 36
37. Use of UDP
• Suitable for process that requires simple request-
response communication, like FTP.
• Suitable for a process with internal flow and error
control like Trivial File Transfer Protocol (which has
its own error and flow control).
• Suitable for multicasting.
• Used for route updating protocol.
ADAD 37
38. TCP
• Transmission Control Protocol.
• Like UDP, use port numbers.
• Connection oriented (create virtual connection
between two TCPs to send data).
• Use flow and error control.
• Full duplex communication.
• Connection oriented and reliable protocol.
ADAD 38
39. TCP Services
1. Process-to-Process communication: Using port numbers.
ADAD 39
Port Protocol Description
7 Echo Print a received datagram back to sender.
9 Discard Discards any datagram that is received.
11 User Active user.
13 Daytime Returns the date and time
20 FTP, Data File transfer Protocol(data connection)
21 FTP, Control FTP (control connection)
25 SMTP Simple Mail Transfer Protocol
53 Nameserver Domain Name Service
80 HTTP Hypertext Transfer Protocol
40. TCP Services
2. Stream Delivery Services: Stream Oriented Protocol.
• Allow the sending process to deliver data as a stream of
bytes and allows to receiving process to obtain as a stream.
• Create an imaginary “tube” that carries their data across the
internet.
ADAD 40
41. TCP Services
Sending and Receiving Buffers: Because sending and
receiving processes may not write or read data at the same
speed TCP needs buffer for storage.
Useful in Segmentation also.
ADAD 41
42. TCP Features
1. Numbering System: No segment number but, Segment
Number=(Sequence number and Acknowledgement number).
2. Byte Numbers: store byte into sending buffer and number
them (generate random numbers between 0 to 2^35-1)
3. Sequence Number: After the byte no. sequence number is
assigned. SN number for each segment is the number of the
first byte carried in that segment.
4. Acknowledgement Number: Conform the byte is received. And
define the number of byte that next except to receive.
5. Flow control
6. Error control
7. Congestion Control
ADAD 42
44. TCP Segment Fields
1. Source Port Address: 16 bit; sender’s port number.
2. Destination Port Address: 16-bit; receiver’s port number.
3. Sequence Number: 32-bit; Define the number assigned to the first
byte of data contained that segment.
4. Acknowledgement Number: 32-bit; define byte number that the
receiver of the segment is expecting (X) to receive from the other
party then reply would be X+1.
5. Header Length: 4-bit; header can be between 20 to 60 bytes.
6. Reserved: 6-bit; reserved for future.
7. Window size: 16-bit; value is normally referred to as receiving
window.
8. Checksum
9. Urgent Pointer: Valid only if urgent flag is set.
10. Options: any optional data.
ADAD 44
45. TCP Segment Fields
7. Control: 6 different flags.
ADAD 45
Flag Description
URG 16-bit; valid only if urgent flag is set; is used when segment contains
some urgent data.
ACK Successful Acknowledgement.
PSH PUSH similar to URG; tells the receiver to process these packets as they
are received instead of buffering them.
RST Reset the connection.
SYN Synchronization flag, is used as a first step in establishing a 3-way
handshake between two hosts
FIN Finished; Terminate the connection.
46. A TCP Connection
• Connection Oriented – use a virtual path between source
and destination.
• All the segments belong to a message are sent over this
path.
• Use a single path for entire message; acknowledgement
process and retransmission of damaged or lost frames.
• Path is virtual not physical.
• Three phases: Three-Way Handshaking
1. Connection Establishment
2. Data Transfer
3. Connection Termination
ADAD 46
47. TCP Connection Establishment
• Full-Duplex Mode
• For transmission/ communication of data each party has to
take permission of receiver.
• The process works like:
1. The server program tells its TCP that it is ready to accept a
connection (if it is passive).
2. The client program issue a request for an active open.
3. A client that need to establish a connection tells to the particular
server that it need to generate a connection.
4. Starts Three-way handshaking process.
5. Each connection shows Sequence number, acknowledgement
number, control flags and window size.
ADAD 47
49. 1. TCP Connection Establishment Using Three-
way Handshake
1. Client send first SYN segment, in which SYN flag is set for
synchronization of sequence number.
2. Server send two flag bits set: SYN+ACK.
3. Client send just an ACK segment just to acknowledge of
second segment from server.
Now connection is established.
And ready to transfer data.
ADAD 49