Computer Networks: A Systems Approach - Chapter 1 Foundation
Defining the Computer Network
- A computer network is distinguished from specialized networks (like voice telephone or cable TV networks) by its generality. Unlike specialized networks optimized for a single data type (keystrokes, voice, or video) and specialized devices, computer networks are built from general-purpose programmable hardware.
- Computer networks are not optimized for a specific application but can carry many different types of data to support an ever-growing range of applications.
- Building a network involves identifying available building blocks (hardware and software) and designing an architecture to integrate them into an effective communication service.
- Networks must be considered from three distinct perspectives: that of the builder (who designs the protocols and hardware), the operator (who manages and configures the system), and the application developer (who creates services on top of the network).
Classes of Network Applications
- The World Wide Web (WWW) is often confused with the Internet itself, but it is an application running on top of it.
- A Uniform Resource Locator (URL), such as
http://www.cs.princeton.edu/~llp/index.html, identifies objects on the Web. The string http denotes the Hypertext Transfer Protocol (HTTP), www.cs.princeton.edu is the server name, and /~llp/index.html is the specific page identifier. - A single web click can trigger over a dozen messages:
- Up to six messages to translate the server name to an Internet Protocol (IP) address (e.g., 128.112.136.35).
- Three messages to establish a Transmission Control Protocol (TCP) connection.
- Four messages for the HTTP "GET" request, response, and acknowledgments.
- Four messages to terminate the TCP connection.
- Streaming audio and video (e.g., video on demand) differ from web pages because humans consume them continuously. Discontinuities, such as skipped sounds or stalled video, are unacceptable. In contrast, text and images can be delivered and read in bits.
- Real-time audio and video (e.g., Skype or videoconferencing) have even tighter timing constraints. For a telephone call to be tolerable, the round-trip delay should not exceed 300ms; an RTT of 100ms is considered very good. Interactive applications involve flows in both directions, whereas streaming is often one-way.
Network Requirements and Stakeholders
- Requirements are specified by three main stakeholders:
- Application Programmers: Focus on services like guaranteed message delivery, timing, and mobility support.
- Network Operators: Focus on ease of administration, fault isolation, configuration, and usage accounting.
- Network Designers: Focus on cost-effectiveness, efficient resource utilization, fair allocation, and performance.
Scalable Connectivity
- A system scales if it is designed to support growth to an arbitrarily large size.
- Nodes are computers or specialized hardware; a link is a physical medium (coaxial cable, optical fiber) connecting nodes.
- Point-to-point links connect a pair of nodes.
- Multiple-access links allow more than two nodes to share a medium (e.g., Wi-Fi, Ethernet, or cellular). These often provide the "last mile" connection to end users.
- Indirect connectivity is achieved through cooperation between nodes.
- Switched networks use nodes (switches) to forward data from one link to another.
- Packet-switched networks use a store-and-forward strategy, where discrete blocks of data (packets or messages) are received completely by a node, stored in memory, and then forwarded.
- Circuit-switched networks establish a dedicated circuit across links for a bitstream (common in telephone systems).
- An internetwork (internet) is formed by interconnecting multiple independent networks (clouds). A router (or gateway) connects two or more networks and forwards messages between them. The capital "I" Internet refers to the specific global TCP/IP network.
- Nodes are identified by an address (a byte string). Routing is the process of determining how to forward messages based on the destination address.
- Transmission types:
- Unicast: Sending to a single destination.
- Broadcast: Sending to all nodes on a network.
- Multicast: Sending to a specific subset of nodes.
- Network categorization by size:
- LAN (Local Area Network): Typically spans less than 1km.
- MAN (Metropolitan Area Network): Spans tens of kilometers.
- WAN (Wide Area Network): Can be worldwide.
- SAN (Storage/System Area Network): Confined to a single room; used for high-performance computing components.
Cost-Effective Resource Sharing
- Multiplexing is the sharing of a system resource among multiple users.
- Synchronous Time-Division Multiplexing (STDM): Time is divided into equal quanta; flows are given a turn in a round-robin fashion. If a flow has no data, its slot remains idle.
- Frequency-Division Multiplexing (FDM): Flows are transmitted at different frequencies on the same link.
- Statistical Multiplexing: Shares the link over time on demand. Data is transmitted as soon as a flow needs to, without waiting for a fixed slot. Efficiency is gained by avoiding idle time.
- To prevent one flow from monopolizing a link, statistical multiplexing imposes an upper bound on block size, called a packet. Large messages must be fragmented into packets at the source and reassembled at the destination.
- Buffering occurs when a switch receives packets faster than it can send them. If buffer space is exhausted, the switch becomes congested and may drop packets.
- Quality of Service (QoS): Mechanisms to allocate bandwidth fairly or prioritize certain flows.
Support for Common Services
- The network provides logical channels between application-level processes. These channels are abstractions built via layering.
- Request/Reply Channels: Used for file transfer (client-server model) or digital libraries. They guarantee error-free delivery and data integrity/privacy.
- Message Stream Channels: Used for video applications. They support one-way or two-way traffic and ensure data arrives in the correct sequence, even if some packets are lost.
- Semantic Gap: The difference between what an application expects and what the underlying technology provides.
Reliability and Failure Models
- Network designers must account for three classes of failure:
- Bit Errors: Occur when bits are flipped due to interference (lightning, power surges). Error rates are typically 10−6 to 10−7 for copper and 10−12 to 10−14 for optical fiber.
- Packet-level Loss: Packets are dropped due to uncorrectable bit errors or congestion (full buffers).
- Node/Link-level Failure: Physical links cut or nodes crash (e.g., software bugs, power failure, or misconfiguration).
Architecture and Layering
- Layering decomposes complex network designs into manageable, modular components. Lower layers provide services to higher layers.
- Protocols are the abstract objects making up layers. A protocol defines:
- Service Interface: Operations local objects perform on the protocol.
- Peer Interface: Rules governing messages (form and meaning) exchanged with a peer on a remote machine.
- A protocol specification describes the interfaces, while a protocol module is the implementation. Modules that correctly implement a specification interoperate.
- Protocol Graph: A visual representation of a protocol suite where edges represent dependencies.
- Encapsulation: As data moves down the stack, each protocol attaches control information, usually a header at the front (occasionally a trailer at the end). The original data plus higher-level headers is the payload or body.
- Multiplexing/Demultiplexing: Protocols use a demultiplexing key (demux key) in the header to identify which higher-level protocol or application should receive a message.
Network Reference Models
- Seven-Layer OSI Model (ISO):
- Physical Layer: Transmits raw bits.
- Data Link Layer: Collects bits into frames.
- Network Layer: Handles routing (unit is a packet).
- Transport Layer: Implements process-to-process channels (unit is a message).
- Session Layer: Manages multiple transport streams for an application.
- Presentation Layer: Handles data formats/representation.
- Application Layer: High-level application protocols (e.g., HTTP).
- Internet (TCP/IP) Architecture:
- Layer 1/2: Subnetwork/Link protocols (Ethernet, Wi-Fi).
- Layer 3: Internet Protocol (IP) - the focal point of the architecture.
- Layer 4: Transport protocols (TCP for reliable byte streams, UDP for unreliable datagrams).
- Layer 7: Application protocols (HTTP, SMTP, FTP).
- Hourglass Philosophy: IP is the "narrow waist" of the network. It provides a common method for exchanging packets, allowing diverse transport protocols above it and diverse hardware technologies below it to coexist and evolve.
- IETF: The primary standardization body for the Internet. It relies on a culture of "rough consensus and running code."
- ICANN/IANA: Responsible for stewardship and unique identifiers (addresses).
Network Software and Sockets
- The Socket API is the standard interface provided by operating systems for network programming.
- Basic Socket Operations (TCP):
int socket(domain, type, protocol): Creates a socket. Internet family is PF_INET; byte stream is SOCK_STREAM.int bind(socket, address, len): Binds a socket to a local IP and port number.int listen(socket, backlog): Prepares the server to accept connections.int accept(socket, address, len): Server performs a passive open; blocks until a connection arrives.int connect(socket, address, len): Client performs an active open to a remote address.int send(socket, message, len, flags) and int recv(socket, buffer, len, flags): Exchange data.
- Port numbers serve as demultiplexing keys to identify specific processes.
- Bandwidth (Throughput): Bits transmitted per unit of time (e.g., Mbps, Gbps).
- Latency (Delay): Time for a message to travel end-to-end.
- Round-Trip Time (RTT): Time for a message to go to a destination and back.
- Components of Latency: Latency=Propagation+Transmit+Queue
- Propagation=SpeedOfLightDistance
- Transmit=BandwidthSize
- Speed of light in media:
- Vacuum: 3.0×108m/s
- Copper: 2.3×108m/s
- Fiber: 2.0×108m/s
- Units in Networking:
- Bandwidth: Uses base-10 (1kbps=103bps; 1Mbps=106bps).
- Storage/Message Size: Uses base-2 (1kB=210bytes; 1MB=220bytes).
Delay × Bandwidth Product
- This product represents the "volume" of the pipe: the maximum bits in transit at any instant.
- It determines how much data a sender must transmit before the first bit reaches the receiver and an acknowledgment can be returned.
- To fully utilize a link, the sender must keep at least one RTT × Bandwidth's worth of data "in flight."
- Example: A transcontinental fiber with 10Gbps bandwidth and 40ms RTT has a product of 400Mb.
- As bandwidth increases, latency (limited by the speed of light) stays constant. Networking becomes latency-dominant.
- Throughput calculation for a transfer:
- TransferTime=RTT+Bandwidth1×TransferSize
- EffectiveThroughput=TransferTimeTransferSize
- For small transfers, RTT dominates the total time, and the effective throughput is much lower than the link bandwidth.
- Average vs Peak Bandwidth: Applications like video have variable rates. Burstiness requires enough buffer space in the network to avoid drops.
- Jitter: Variation in latency. If video frames arrive with variable interpacket gaps, the receiver uses a playback buffer to smooth out the jitter, ensuring a consistent frame rate.