Download Protocol Machinery-Advance Computer Networking-Lecture Slides and more Slides Computer Networks in PDF only on Docsity!
Protocol MachineryMultiplexing and Demultiplexing (demux key)
Encapsulation (header/body) in peer-to-peer interfaces
indirect communication (except at hardware level)
each protocol adds a header
part of header includes demultiplexing field (
e.g.
, pass up to
request/reply or to message stream?)
5
Message Transmission Using Layers
6
Standard Architectures
-^
Open System Interconnect (OSI) Architecture– International Standards Organization (ISO)– International Telecommunications Union (ITU),
formerly CCITT
- “X dot” series: X.25, X.400, X.500– Primarily a reference model
8
Internet Architecture
-^
TCP/IP Architecture– Developed with ARPANET and NSFNET– Internet Engineering Task Force (IETF)
- Culture: implement, then standardize• OSI culture: standardize, then implement
- Became popular with release of Berkeley Software
Distribution (BSD) Unix; i.e. free software
- Standard suggestions traditionally debated publically
through “Request For Comments” (RFC’s)
9
Internet Architecture
-^
Implementation and design done together
-^
Hourglass Design (bottleneck is IP)
-^
Application vs Application Protocol (FTP, HTTP)
…
NET
n
NET
2
NET
1
IP
TCP
UDP
FTP
HTTP
NV
TFTP
11
Network Models
12
How Layers Fit Together in Practice
14
Protocol Acronyms
•^
(T)FTP – (Trivial) File Transfer Protocol
-^
HTTP – Hyper Text Transport Protocol
-^
NV – Network Video
-^
SMTP – Simple Mail Transfer Protocol
-^
NTP – Network Time Protocol
-^
TCP – Transmission Control Protocol
-^
UDP – User Datagram Protocol
-^
IP – Internet Protocol
-^
FDDI – Fiber Distributed Data Interface
-^
ATM – Asynchronous Transfer Mode
15
Elements of a Protocol
Implementation
-^
Outline– Service Interface– Process Model– Common Subroutines– Example Protocol
17
Network Application Programming
Interface (API)
-^
Interface that the OS provides to its networkingsubsystem– most network protocols are implemented in software– all systems implement network protocols as part of the OS– each OS is free to define its own network API– applications can be ported from one OS to another if APIs
are similar• IF application program does not interact with other
parts of the OS other than the network (file system, forkprocesses, display …)
18
Protocols and API
- Protocols provide a certain set of
services
syntax
by which
those services can be invoked
- Implementation is responsible for
mapping API syntax onto protocolservices
20
Socket API
int
socket
(int domain, int type, int
protocol)^ • domain (family) = AF_INET, PF_UNIX,
AF_OSI
- type = SOCK_STREAM, SOCK_DGRAM• protocol = TCP, UDP, UNSPEC• return value is a
handle
for the newly
created socket
21
Sockets (cont)
-^
Passive Open (on server)^ int
bind
(int socket, struct sockaddr *addr, int
addr_len)
int
listen
(int socket, int backlog)
int
accept
(int socket, struct sockaddr *addr, intaddr_len)
-^
Active Open (on client)^ int
connect
(int socket, struct sockaddr *addr, int addr_len)