Internetworking with UNIX TCP/IP (CS 475) - Suraj @ LUMS

hollowtabernacleNetworking and Communications

Oct 26, 2013 (3 years and 9 months ago)


Introduction to TCP/IP 1
Internetworking with UNIX
TCP/IP (CS 475)
Syed Mansoor Sarwar
Introduction to TCP/IP 2
Client-Server Paradigm
• Software (application and/or OS) divided into two parts and results in
two separate executable codes called client and server
• Usually message oriented
• Built around application protocols (for applications such as ftp, http,
and telnet)
• The client process sends a request to the server process by using some
underlying transport protocol (TCP or UDP)
• Clients are usually designed for a single service
• Servers can be single-protocol (TCP or UDP) or multi-protocol (TCP
and UDP)
• Servers can be single-service (ftp, time, daytime, echo, telnet) or
multi-service (many services handled by a single server)
Introduction to TCP/IP 3
Client-Server Paradigm (cont.)
• Servers can be connectionless (UDP) or connection-oriented (TCP)
• Servers can be interative (service one request at a time - TCP/UDP) or
concurrent (master-slave model)
• The server process must be running before a client can request a
• TCP/IP does not support invocation of a server on a message arrival so
all services must be designed as client-server applications (i.e., TCP/IP
does not support any rendezvous mechanism for process invocation)
• UNIX / LINUX mechanisms (primitives) for IPC based on the client-
server model: pipe, named pipe (FIFO), message queues,
BSD socket, System V Transport Layer Interface
Introduction to TCP/IP 4
What is a Network
• A collection of interconnected computing resources
• Types of networks: Local Area Networks (LANs), Metropolitan
Area Networks (MANs), Wide Area Networks (WANs), and
internetworks (internet for short)
• internet - a set of networks connected together
• A computing resource on a network is called a host
• Types are based on the maximum distance between two hosts
• A special internetwork that connects millions of hosts on thousands of
networks around the globe (and beyond) in called the Internet
Introduction to TCP/IP 5
What is the Internet
• An open system with a suite of many application protocols (and their
implementation) on top of TCP/UDP/IP on many physical networks
(RS-232, Ethernet, ATM, Token Ring, FDDI, etc.)
• The World Wide Web (http/TCP)
• Chat rooms for people who don’t appreciate time and/or space
• A mechanism for free long-distance telephone calls
• A computer network that survive atomic attacks
• A computer network where network security is an oxymoron
• … many points of view
• Internet: A network of networks around the world connected together
with TCP/IP
Introduction to TCP/IP 6
Who Controls the Internet
• Internet is world-wide -- question of government control is very interesting
• Internet Society (ISOC), Internet Architecture Board (IAB), Internet
Engineering Task Force (IETF), Internet Research Task Force (IRTF),
Internet Assigned Numbers Authority (IANA)
• But industry may preemptively determine standards -- Netscape/Microsoft
• ISOC -- professional society to facilitate, support, and promote Internet
• IAB -- technical oversight and coordination; falls under ISOC
• IETF -- meets 3 times a year, develops, argues over, and standardizes
protocols for the Inernet. 70-80 members. Organized in areas, e.g., routing
• IRTF -- long term research; just a few people compared to IETF
• IANA -- Port numbers for well-known services
Introduction to TCP/IP 7
Standards Process
• Standards for the Internet are called Requests For Comments (RFCs)
• Current number : 3429
• IETF members write drafts that eventually becomes standards; not all
protocols have RFCs and not all RFCs are actually used (some are just
• Index entry include: Title, author, date became a standard (or
proposed), format (text, postscript, etc.), obsoletes which RFC,
obsoleted by which RFC, status (standard, informational, historic, etc.)
• Some important RFCs:
– RFC 1700 Assigned Numbers (assigned Internet protocol numbers, ports for well-known
services, values for options of protocols and various services)
– RFC 1500 Official Protocol Standards (obsoleted many times, latest standard it RFC 2800)
– RFC 1122, 1123 Host and protocol requirements
• See for the latest information
Introduction to TCP/IP 8
TCP/IP Protocol Stack
• TCP/IP Protocol Model
– 4/5-layer model :Device/Link, Network, Transport, Applications
– Device/link : ARP, RARP, SLIP, PPP, ISDN, Ethernet, Phone line
– Network : IP, ICMP, IGMP
– Transport : TCP, UDP, “raw” IP
– Application : Telnet, SMTP, FTP, HTTP, DNS, NFS, BOOTP, PING, ...
Introduction to TCP/IP 9
TCP/IP Stack Implementations
• TCP/IP Protocol Stack -- Implemented in the O.S.
• De facto source standard is BSD UNIX
– 4.2 BSD 1983 First widely distributed TCP/IP implementation
– 4.3 BSD 1986 Performance improvements
– 4.3 BSD Tahoe 1988 Congestion avoidance
– 4.3 BSD Reno 1990 Slip header, compression, new router algorithm
– 4.4 BSD 1993 Multicasting
Introduction to TCP/IP 10
TCP/IP Architecture
• Data flows up/down the stack
– On a write, each layer adds its header before sending data to the lower
layer. This process is called encapsulation and it allows peer-to-peer
communication between layers.
– On a read, each layer de-multiplexes the data received from the lower
layer because the upper layer has many possible destinations.
– For example, when the link layer protocol receives data from the network
channel, it could be for IP, ARP, or RARP.
– What about data received by IP from the lower layer?
Introduction to TCP/IP 11
Big Ideas
• Peer-to-peer communication
– Http client (e.g., Netscape) talks to http server
– Source TCP talks to destination TCP
– Source IP talks to destination IP and next-hop IP
• Network layer hides the Application and Transport layers from the
details of the physical network
– Routers glue networks together and forward packets between packets
– Networks can use different technologies and routers transform packets to
meet standards for each network
– A router operates at the network layer level and has interfaces on multiple
Introduction to TCP/IP 12
Hosts, Routers, and Protocol
• A host is any system attached to an internet that runs applications
• Hosts may be supercomputers or refrigerators
• TCP/IP allows any pair of hosts on an internet to communicate directly
• Both hosts and routers have TCP/IP stacks
– Hosts (typically) have one interface and don’t forward packets
– Routers have at least two interfaces and don’t need layers 4 and 5 for
packet forwarding