Computer Network
Computer Network
1. Overview of Computer Networks
Classification
By switching technology: circuit switching, message switching, packet switching
By user type: public network, private network
By transmission medium: wired network, wireless network
By coverage area: WAN (Wide Area Network), MAN (Metropolitan Area Network), LAN (Local Area Network), PAN (Personal Area Network)
By topology: bus, star, ring, mesh
Performance Metrics
Speed: data unit (bit)
Bit unit calculation: 8bit=1B KB=210B MB=210x210B ... Speed calculation: b/s=bps/s Kbps=103bps/s Mbps=103x103bps/s ...
Bandwidth: the data transmission capacity of a communication link, the "maximum rate" that can pass from one point to another per unit of time
Units and calculation methods are the same as speed
Throughput: the amount of data passing through a network (channel, interface) per unit of time; the actual data volume passing through the network, affected by network bandwidth and rated speed (less than or equal to speed)
Delay: transmission delay, propagation delay, processing delay (when geographically co-located, transmission delay dominates for large data)
Transmission delay calculation: packet length (b) / transmission rate (b/s); transmission rate takes the minimum of NIC speed, channel bandwidth, and interface rate Propagation delay calculation: channel length (m) / electromagnetic propagation speed (m/s); free space: 3x108 m/s, copper wire: 2.3x108, optical fiber: 2x108 Processing delay: includes queuing delay (router store-and-forward, computationally complex)
Delay-bandwidth product: propagation delay x bandwidth
- Round-trip time: the time for a single bidirectional information exchange (RTT)
Utilization (backbone ISPs generally keep channel utilization below 50%; exceeding this causes network delay to increase rapidly)
Channel utilization: indicates what percentage of time a channel is being utilized (data passing through) Network utilization: the weighted average of all channel utilizations across the network
Packet loss rate: the ratio of lost packets to total packets within a given time period
Causes of packet loss: bit errors during transmission, or packets being dropped when arriving at switches or routers with full queues (high traffic volume easily causes network congestion)
Computer Network Architecture
Common Computer Network Architectures
OSI 7-Layer Model (original academic architecture)
Application Layer Presentation Layer Session Layer Transport Layer Network Layer Data Link Layer Physical Layer
TCP/IP Architecture (commercially driven)
Application Layer (HTTP, SMTP, DNS, RTP) Transport Layer (TCP, UDP) Internet Layer (IP) Network Interface Layer
Theoretical Architecture (pedagogical model)
Application Layer Transport Layer Network Layer Data Link Layer Physical Layer
The Necessity of Layered Computer Network Architecture
Physical Layer (what signals are used to transmit bits)
Transmission media
Physical interfaces
Using signals to represent bits 0/1
Data Link Layer (transmission over a single network or link segment)
How to identify hosts in the network (host addressing, e.g., MAC address)
How to distinguish addresses and data from a continuous bit stream represented by signals
How to coordinate hosts competing for the bus
Network Layer (solving the problem of packet routing across multiple networks)
How to identify each network and hosts within networks (combined network and host addressing, e.g., IP address)
How routers forward packets and perform route selection
Transport Layer (solving network-based communication between processes)
How to solve process-to-process communication over the network
How to handle transmission errors
Application Layer (solving specific network application needs through application process interaction)
Completing specific network applications through interaction between application processes
Terminology
Entity: any hardware or software process capable of sending or receiving information. Peer entities (entities at the same layer on both sending and receiving sides, e.g., network interface cards)
Protocol: a set of rules controlling logical communication between two peer entities (HTTP protocol, TCP protocol, IP protocol, etc.)
Syntax: defines the format of exchanged information (e.g., IP header + data format)
Semantics: defines the operations to be performed by both communicating parties (e.g., HTTP GET request and HTTP response message)
Synchronization: defines the timing relationship between communicating parties (TCP three-way handshake)
Service
Under protocol control, logical communication between two peer entities enables the current layer to provide services to the layer above
To implement the current layer's protocol, services provided by the layer below are also needed
Protocols are "horizontal"; services are "vertical"
Service access points: frames, protocol fields (IP), port numbers
Service primitives: the upper layer must exchange certain commands with the lower layer to use its services
Protocol Data Unit (PDU): data packets transmitted between peer layers
Bit stream (bit)
Frame
Packet
Segment (TCP) / Datagram (UDP)
Message
Service Data Unit (SDU): data packets exchanged between layers within the same system
Multiple SDUs can be combined into one PDU; one SDU can also be divided into several PDUs
Delay and propagation time exercise calculations:
2. TCP/IP Architecture
Physical Layer
Transmission Media
Guided media
Twisted pair
Coaxial cable
Optical fiber
Unguided media
Radio waves
Infrared
Microwave communication (2~40 GHz)
Visible light
Main Tasks of Physical Layer Protocols
Mechanical characteristics
Electrical characteristics
Functional characteristics
Procedural characteristics
The Physical Layer is concerned with how to transmit data bit streams over various computer transmission media It shields the Data Link Layer from the differences between various transmission media, so the Data Link Layer only needs to consider how to implement its own protocols and services without worrying about the specific underlying transmission
Transmission Modes
Serial transmission: computer networks
Parallel transmission: CPU --> memory bus parallel transmission
Synchronous transmission: sender and receiver clocks synchronized
External synchronization: a separate clock signal line added between sender and receiver
Internal synchronization: the sender encodes the clock synchronization signal into the transmitted data (e.g., Manchester encoding)
Asynchronous transmission
Synchronization between bytes (start bit, stop bit)
Each bit within a byte is still synchronized
Simplex: radio
Half-duplex: walkie-talkie
Full-duplex: telephone
Encoding and Modulation
Data Link Layer
Framing
Adding frame header and trailer: MAC frame
Error Detection
Frame trailer error detection code
Parity check
Cyclic Redundancy Check (CRC)
Reliable Transmission
Stop-and-Wait protocol (SW)
Go-Back-N protocol (GBN)
Selective Repeat protocol (SR)
Point-to-Point Protocol (PPP)
Media Access Control
Random Access
CSMA/CD protocol
CSMA/CA protocol
MAC Address, IP Address, and ARP Protocol
Hubs and Switches
VLAN Technology
Network Layer
Overview
IPv4 Addresses
Classification
Subnetting (subnet mask)
Classless IPv4 addressing: CIDR. For example: the CIDR block for 192.168.10.1/20 is --> 192.168.0~192.168.15
Fixed-Length Subnet Mask (FLSM) and Variable-Length Subnet Mask (VLSM)
IP datagram sending and forwarding process
Routing protocol overview
Static routing: manually configured network routes, default routes, host-specific routes, black hole routes
Dynamic routing: automatically obtaining routing information through routing protocols
Routing Information Protocol: RIP (distance-vector based)
Routing protocol: Open Shortest Path First (OSPF) basic working principle (link-state based)
Routing protocol: Border Gateway Protocol (BGP)
IPv4 datagram header format
Internet Control Message Protocol (ICMP)
Destination unreachable, source quench, time exceeded, parameter problem, redirect
ping、traceroute
Virtual Private Network (VPN) and Network Address Translation (NAT)
Transport Layer
TCP vs. UDP Comparison
TCP Principles
Flow control (sliding window)
Congestion control
Tahoe version
Slow start
Congestion avoidance
Reno version
Fast retransmit (sender retransmits as soon as possible, without waiting for timeout timer)
Fast recovery
Retransmission timeout selection (RTO retransmission timeout value)
Reliable transmission implementation
Three-way handshake and four-way teardown
Header format
Application Layer
Client/Server Model and P2P Model
DHCP, DNS, FTP, SMTP, HTTP and Other Protocols
Last updated