COP4610: Operating Systems & Concurrent Programming |
up ↑ |
OS Support for Networking
Spectrum of Distributed Capabilities
- Communications architecture (e.g., TCP/IP)
running on individual OS's supports
communication between systems
- Network operating system
individual OS's on each computer coordinated to provide
remote services (e.g., file and printer sharing), supported
by a common OS "adjunct"; individual systems are still visible
- Distributed operating system
single integrated OS manages collection of networked resources
so as to appear to be a single system
Terminology
- Computer communictions
enables the exchange of information between computers
- Computer network
collection of interconnected computers
- Protocol
rules/conventions enabling communication, including:
- syntax: how is data formatted? what are signal levels?
- semantics: control/coordination information
- timing: speed, sequencing
- Protocol architecture
breaks down implementation of protocol into tasks and modules
Example: File Transfer (a simplified architecture)
TCP/IP Protocol Architecture
- is a protocol suite
- can be divided into layers:
- physical
- network access
- internet
- host-to-hoste, or transport
- application
Physical Layer
- characteristics of the transmission medium
- nature of the signals
- data rate
- bit encoding
- etc.
Network Access Layer
- how data is exchanged between end system and network
- alternate standards, e.g.
- circuit switching
- packet switching (frame relay)
- LANs (Ethernet)
Internet Layer
- how is data routed across the network, and between networks
- implemented by both end systems and routers
- this is the layer of the Internet Protocol (IP)
Transport Layer
- how is integrity and transmission order of data preserved
- implemented by end systems
- this is the layer of the Transmission Control Protocol (TCP)
TCP uses a "sliding window" to manage retransmissions
Application Layer
examples:
- file transfer (FTP)
- remote shell (SSH)
- remote procedure call (RPC)
- browser service (HTTP)
TCP/IP Concepts
TCP Header
UDP Header
IPv4 Header
IPv6 Header
IPv6
- extends and improves on IPv4
- accomodates higher speeds, mixture of data streams, graphics and video
- larger address space (128 vs. 32 bits)
DS = Differentiated services field (formerly Type of Service)
ECN = Explicit congestion notification field (formerly Traffic Class)
This is only the first header. Other information (including some of what is contained in the IPv4 header) may
be contained in additional (chained) headers.
Items in the Header
- destination network address
- source network address
- length
- facilities requests (e.g., priority)
- etc.
Protocols and Headers (packet nesting)
Protocol Data Units (PDUs) in the TCP/IP Architecture
TCP/IP Applications (examples)
- Simple Mail Transfer Protocol (SMTP)
- File Transfer Protocol (FTP)
- Hypertext Transfer Protocol (HTTP)
- TELNET
- Secure Shell (SSH) Protocol
Most protocols are standardized via RFC's (Requests for Comment)
by the IETF (Internet Engineering Task Force). They starts out as requests for comment (proposals) and
some are eventually widely enough aceepted that they becomes standards.
Sockets
- enable communications between logical endpoints
- identified via host address + port number
- two types:
- stream: use TCP, connection-oriented, provide reliable data transfer
- server: accepts connections (passively waits)
- client: requests connection (actively initiates)
- datagram: use UDP, delivery is not guaranteed
Socket Setup
- created via socket command
- parameters:
- protocol family: PF_INET foro TCP/IP
- type: stream or datagram
- protocol: TCP or UDP
TCP Socket Usage: Server Side
- socket: creates socket
- bind: associates local port with socket
- listen: allow client connections
- accept: accept one connect (creates new socket per connection)
- recv/read, send/write: transfer data between sockets
- close/shutdown: shut down connection
TCP Socket Usage: Client Side
- socket: creates socket
- connect: connects to server identified by host address and port
- send/write, recv/read: transfer data between sockets
- close/shutdown: shut down connection
Socket System Calls for Connection-Oriented Protocol
Linux Kernel Components for TCP/IP Processing
Example: Trivial File Transfer Protocol (TFTP)
- simplifications: no acess control or user identification
- initiated by client sending to server via UDP to port 69
- client provides TID (client port number for transaction)
- server responds with TID (server port number for transaction)
- data is transferred via UPD using the TIDs
- errors handled by sender timing out and restransmitting if
no ACK received prior to timeout
TFTP Packet Formats
TFTP Error Codes
Value | Meaning |
0 | Not defined, see error message (if any) |
1 | File not found |
2 | Access violation |
3 | Disk full or allocation exceeded |
4 | Illegal TFTP operation |
5 | Unknown transfer ID |
6 | File already exists |
7 | No such user |
A TFTP Packet in Context
TFTP Operation