










Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
This lecture was delivered for Network Programming course by Prof. Tausiq Dasgupta at Babasaheb Bhimrao Ambedkar University. It includes: Protocol, Architecture, Activation, Destination, Handshaking, Network, Access, module, Hardware, Datalink
Typology: Slides
1 / 18
This page cannot be seen from the preview
Don't miss anything!











Protocol Architecture
Protocol Tasks
File Transfer Application
Communications Service Module
Network Access Module
File Transfer Application
Communications Service Module
Files and file transfer commands
Communications-related messages
Protocol Layers
Open Systems Interconnect
Developed by ISO
7-layers communication model
one large problem decomposed into several more manageable sub-problems
supports modularity
promotes interoperability between vendors
widely used as reference model only
TCP/IP developed in early 1970s by DoD
designed to solve specific problems
ISO established OSI committee in 1977
expected that OSI would be universally adopted
market required a solution, so TCP was adopted
difficulties replacing TCP into OSI
OSI model
higher layers rely on lower ones to perform more primitive
functions
changes in one layer should not require ones in other
layers, but it is not always possible
functions and parameters passed at interface
standards can be developed independently and
simultaneously for each layer
The Seven Layers contd.
Network layer
provides for the transfer of information between end
systems across some sort of communications network
network addressing
Transport layer
provides a mechanism for the exchange of data between
end systems
ensures delivery of data
error free, no losses, in sequence
connection-oriented , connectionless
The Seven Layers contd.
Session layer
lowest four layers: provide the means for the reliable
exchange of data and provide an expedited data services
some applications - control dialogue, backup and recovery
provides the mechanism for controlling the dialogue
between applications in end systems
dialogue discipline - full duplex or half duplex
grouping - define groups of data
recovery - a checkpointing mechanism
The Seven Layers contd.
Presentation Layer
offers application programs a set of data transformation
services
defines syntax between applications
Application Layer
provides a means for application programs to access OSI
environment
file transfer, electronic mail, remote terminal access etc.
Introduction
Client / Server
Client Server
Client
Client
Client
Server
...
...
Class A
Dotted Decimal Notation
Subnetting
Subnetting is a method of locally modifying
the use of the network and hosts bits.
Routing
Routing is the method by which packets of data are sent from
one computer to another in the most efficient way possible. The
routing process is composed of several components as follows:
Determining what paths are available between the source and destination computers
Selecting the “best” path between the source and destination computers where “best” may mean different things depending on the goals Using those paths to reach other computers
Adjusting the datagram formats to fit into the underlying physical network technology
In a TCP/IP network, routing is performed by the IP layer. The network id of the destination computer’s IP address as well as the subnet mask are used by the IP layer to make routing decisions.
Unix Standards
POSIX
Potable Operating System Interface
a family of standards being developed by IEEE
The Open Group
an international consortium of vendors and end-user
customers from industry, government, and academia.
IETF (Internet Engineering Task Force)
a large open international community of network
designers, operators, vendors, and researchers
concerned with the evolution of the Internet architecture
and the smooth operation of the internet.
TCP: Transmission Control Protocol
Provides connections between clients and
servers.
Provides reliability.
TCP also sequences the data by associating
a sequence number with every byte that it
sends.
TCP provides flow control.
TCP Connection Establishment and Termination
Three-Way Handshake
SYN segment
ACK
socket,bind,listen socket accpet(blocks) connect(blocks) (action open)
connect returns
accept returns read(blocks)
ack K + 1
SYN^ K^ , ack
FFFF i gi gi gi g uuuu r er er er e 2. 22. 22. 22. 2 TCP three- way handshake
TCP Header
16- bit source port number 16- bit destination port number
32- bit sequence number
32- bit acknowledgment number
4- bit header 16- bit window size length
reserved (6bit)
16- bit TCP checksum 16- bit urgent pointer
option (if any)
data (if any)
F I N
S Y N
R S T
P S H
A C K
U R G
20 bytes
TCP Header FormatTCP Header FormatTCP Header FormatTCP Header Format
Minimum of 20 Octets long
Description of components:
Source Port (16 bits):
specifies sending user of TCP
many common ports assigned special numbers
Destination Port (16 bits)
specifies receiving user of TCP
Sequence Number (32 bits)
number of first data octet in this segment
octet bound, not segment bound: stream oriented
Acknowledgment Number (32 bits)
used for piggy-back acknowledgment
contains sequence # of next octet destination expects to get
TCP Connection Establishment and Termination
(cont)
TCP Options
MSS option
With this option the TCP sending the SYN announces
its maximum segment size , the maximum amount of
data that it is willing to accept in each TCP segment,
on this connection.
Window Scale option
Timestamp option
TCP Connection Termination
TCP Connection Establishment and Termination
(cont)
close
close (active close)
connect returns
(passive close) read returns 0
ack N + 1
ack^ M^ + 1
FFFF i gi gi gi g u r eu r eu r eu r e (^) 2. 32. 32. 32. 3 Packets exchanged when a TCP connection is closed.
TCP
Connection
Establishme
nt and
Termination
(cont)
CLOSED
LISTEN
ESTABLISHED
SYN_RCVD SYN_SENT
CLOSE_WAIT
FIN_WAIT_1 CLOSING LAST_ACK
FIN_WAIT_2 TIME_WAIT
starting point
passive open
data transfer state
active open
simultaneous close
2MSL timeout
passive close
appl: passive open send: < nothing>
appl: active open sen d : SYN
rec v: SYN;
s en d : SYN , ACK rec v: RST recv: SYN send: SYN, ACK sen d : < n o thing >^ re c v: AC K^ simultaneous open
re c v: SYN, ACK recv: FINsen d : ACK send: ACK
recv: ACK send: < nothing>
appl: close or timeout
recv : close send: FIN appl: c lose sen d : FIN
recv : ACK send: < nothing>
recv : FIN send: ACK
re cv: FIN , AC K sen d : AC K
recv : FIN send: ACK
recv : ACK send: < nothing>
active close
FFFF i gi gi gi g u r eu r eu r eu r e 2222. 4. 4. 4. 4 TCP state transition diagram
transition
diagram
Watching
the Packets
TCP Connection Establishment and Termination
(cont) (^) c l i e n t ccc l i e nl i e nl i e n ttt^ s e r v e rs e r v e rs e r v e rs e r v e r socket,bind,listen LISTEN(passive open) accpet(blocks)
socket connect(blocks) (action open) SYN_SENT
ESTABLISHED connect returns ESTABLISHED accept returns read(blocks)
SYN J , m ss = 1460
ack K + 1
SYN^ K^ , ack^ J
FFFF i gi gi gi g u r eu r eu r eu r e 2222. 5. 5. 5. 5 Packet exchange for TCP connection
close LAST_ACK
close (active close) FIN_WAIT_ CLOSE_WAIT (passive close) read returns 0
FIN M
ac k N + 1
ack^ M^ + 1
FIN^ N
write read(blocks) read returns
read returns
CLOSED
FIN_WAIT_ TIME_WAIT
data ( reply) ack of req uest
data( request)
ack o f reply