Skip to content

Commit c0e3840

Browse files
committed
docs: Add content for cs302
1 parent ad60b8e commit c0e3840

57 files changed

Lines changed: 9106 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Network Architecture and OSI Model
2+
3+
## Introduction
4+
5+
Computer networks form the backbone of modern digital communication, enabling everything from email and web browsing to video conferencing and cloud computing. Understanding network architecture is essential for any computer scientist or software engineer working with distributed systems.
6+
7+
This topic introduces the fundamental concepts of computer networking, focusing on how networks are structured and organized. We explore the layered approach to network design, which allows complex communication systems to be broken down into manageable components that can be developed and maintained independently.
8+
9+
## The Need for Network Architecture
10+
11+
When the first computer networks were developed in the 1960s and 1970s, engineers quickly realized that building monolithic networking systems was impractical. Different organizations had different hardware, different requirements, and different ways of solving similar problems. The solution was to develop standardized architectures that defined clear interfaces between components.
12+
13+
A layered architecture provides several key benefits: modularity allows different layers to evolve independently; abstraction hides implementation details from upper layers; interoperability enables equipment from different vendors to work together; and standardization ensures that protocols can be implemented consistently across platforms.
14+
15+
## Learning Objectives
16+
17+
By the end of this topic, you will be able to:
18+
- Explain the purpose and benefits of layered network architectures
19+
- Describe the seven layers of the OSI model and their functions
20+
- Compare and contrast the OSI model with the TCP/IP model
21+
- Identify which protocols operate at each layer
22+
- Analyze network communication in terms of protocol layers
23+
- Understand encapsulation and decapsulation processes
24+
- Apply layered thinking to troubleshoot network problems
25+
26+
## Key Concepts
27+
28+
This topic covers the OSI (Open Systems Interconnection) reference model, which provides a conceptual framework for understanding network communication. While the OSI model is primarily a teaching tool today, its influence on networking terminology and concepts remains profound. We also examine the TCP/IP model, which represents the practical architecture of the modern Internet.
29+
30+
Understanding these models is crucial for grasping how data travels from one application to another across potentially vast networks, passing through multiple intermediate devices and transforming along the way.
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Network Fundamentals
2+
3+
## What is a Computer Network?
4+
5+
A computer network is a collection of computing devices connected together to share resources and communicate. Networks range from simple two-computer setups to the global Internet connecting billions of devices. Understanding networks begins with grasping their fundamental purpose: enabling communication and resource sharing.
6+
7+
Networks evolved from the desire to share expensive computing resources. In the 1960s, computers were large, expensive mainframes. Connecting multiple terminals to a single computer allowed many users to share its processing power. As computers became cheaper and more numerous, the focus shifted to connecting computers to each other, enabling file sharing, message passing, and distributed computing.
8+
9+
## Network Components
10+
11+
Every network consists of several basic components. **End systems** (or hosts) are the devices that send and receive data—computers, smartphones, servers, and IoT devices. **Communication links** carry data between devices and can be wired (copper, fiber optic) or wireless (radio, satellite). **Network devices** like switches and routers forward data between different parts of the network.
12+
13+
The **network interface card (NIC)** connects a host to the network, providing both physical connectivity and an address (MAC address) that uniquely identifies the device on its local network. Modern computers have NICs built into their motherboards, though specialized applications may use dedicated network cards.
14+
15+
## Types of Networks
16+
17+
Networks are commonly classified by their geographic scope. A **Local Area Network (LAN)** connects devices within a limited area like a home, office, or campus. LANs typically use Ethernet or Wi-Fi technology and are owned and operated by a single organization.
18+
19+
A **Wide Area Network (WAN)** spans larger geographic areas, connecting LANs across cities, countries, or continents. WANs often use leased telecommunication lines or internet connections. The Internet itself can be viewed as a global WAN of WANs.
20+
21+
**Metropolitan Area Networks (MANs)** fall between LANs and WANs, typically covering a city or large campus. **Personal Area Networks (PANs)** connect devices within a person's immediate workspace, often using Bluetooth or similar short-range technologies.
22+
23+
## Network Topologies
24+
25+
The **topology** of a network describes how its nodes are connected. Physical topology refers to the actual layout of cables and devices, while logical topology describes how data flows through the network.
26+
27+
Common topologies include:
28+
29+
**Bus topology**: All devices connect to a single cable. Simple and inexpensive, but a single cable failure affects the entire network. Early Ethernet networks used bus topology.
30+
31+
**Star topology**: All devices connect to a central hub or switch. Failure of one connection affects only that device. Most modern LANs use star topology with Ethernet switches.
32+
33+
**Ring topology**: Devices form a circular chain, with each device connected to exactly two others. Data travels around the ring. Token Ring networks used this topology.
34+
35+
**Mesh topology**: Devices have multiple interconnections, providing redundancy. If one link fails, data can take an alternate path. The Internet's core uses mesh topology for resilience.
36+
37+
**Tree (hierarchical) topology**: A combination of star topologies connected in a hierarchy. Common in large organizations with departmental networks connected to a central backbone.
38+
39+
## Packet Switching vs Circuit Switching
40+
41+
Networks use two fundamental approaches to moving data. **Circuit switching**, used in traditional telephone networks, establishes a dedicated communication path between two endpoints before data transfer begins. This path remains exclusive to that communication for its entire duration, guaranteeing consistent bandwidth and low latency but wasting capacity when the path is idle.
42+
43+
**Packet switching**, used in the Internet, divides data into small packets that are sent independently through the network. Each packet may take a different path and is reassembled at the destination. This approach shares network capacity efficiently—links are only used when packets are actually being transmitted—but introduces variable delay and the possibility of packet loss.
44+
45+
The Internet's use of packet switching enables efficient sharing of network resources among many users. Statistical multiplexing allows more users to share a link than circuit switching would permit, though at the cost of occasional congestion when many users transmit simultaneously.
46+
47+
## Network Performance Metrics
48+
49+
Several metrics characterize network performance:
50+
51+
**Bandwidth** (or throughput) measures the rate at which data can be transferred, typically in bits per second (bps). Modern networks may offer megabits (Mbps), gigabits (Gbps), or even terabits (Tbps) per second.
52+
53+
**Latency** measures the time for data to travel from source to destination. It includes transmission delay (time to push bits onto the link), propagation delay (time for signals to travel through the medium), processing delay (time at intermediate devices), and queuing delay (time waiting in buffers).
54+
55+
**Jitter** measures the variation in latency. Consistent latency is important for real-time applications like voice and video.
56+
57+
**Packet loss** occurs when network devices drop packets due to congestion or errors. Lost packets must be retransmitted or tolerated by the application.
58+
59+
Understanding these metrics is crucial for designing, troubleshooting, and optimizing networks. Different applications have different requirements—video streaming prioritizes bandwidth, while interactive gaming prioritizes low latency.
60+
61+
## The Internet
62+
63+
The Internet is not a single network but a network of networks. It consists of thousands of interconnected networks, from small home networks to large corporate networks to massive service provider networks. These networks are connected through Internet Exchange Points (IXPs) and transit agreements.
64+
65+
The Internet's design principles have enabled its remarkable growth and flexibility. Key principles include end-to-end arguments (putting complexity at endpoints rather than in the network), decentralized control, and the use of open standards.
66+
67+
Internet governance involves multiple organizations. The **Internet Engineering Task Force (IETF)** develops technical standards. **ICANN** coordinates global Internet identifiers like domain names and IP addresses. **Regional Internet Registries (RIRs)** allocate IP addresses in different geographic regions.
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Layered Network Architecture
2+
3+
## Why Use Layers?
4+
5+
Network protocols could theoretically be designed as monolithic systems where a single specification handles everything from physical transmission to application semantics. However, the complexity of networking makes this approach impractical. Instead, network architects use layered designs that divide functionality into discrete, manageable modules.
6+
7+
A layered architecture provides several crucial benefits. **Modularity** allows each layer to be developed, tested, and improved independently. **Abstraction** lets each layer use services from lower layers without understanding their implementation details. **Interoperability** enables equipment from different vendors to work together as long as they implement the same layer interfaces. **Flexibility** permits different implementations of a layer as long as they present the same interface.
8+
9+
Think of layers like the postal system. When you mail a letter, you don't need to understand how mail is sorted, transported, or delivered. You simply follow the interface (address format, stamp) and trust the lower "layers" to handle delivery. Similarly, applications don't need to understand packet routing or signal encoding—they use the network layer's interface.
10+
11+
## Protocol Stacks
12+
13+
A **protocol stack** is the set of protocols that a system implements, one (or more) at each layer. For example, a typical Internet host might run HTTP at the application layer, TCP at the transport layer, IP at the network layer, Ethernet at the data link layer, and various protocols at the physical layer depending on the network interface.
14+
15+
Each protocol at a layer communicates with its **peer** protocol at the same layer on another system. This peer-to-peer communication is logical rather than physical—data actually travels down through the layers on the sending side and up through the layers on the receiving side. But the design allows us to think about each layer's protocol independently.
16+
17+
**Protocol data units (PDUs)** have different names at different layers: application data, segments (transport), packets (network), and frames (data link). Understanding these terms helps in discussing network operations at the appropriate level of abstraction.
18+
19+
## Services and Interfaces
20+
21+
Each layer provides **services** to the layer above it and uses services from the layer below. A **service** defines what operations are available, without specifying how they're implemented. The **interface** between layers defines exactly how to request services and receive results.
22+
23+
For example, the transport layer might provide a "reliable byte stream" service to applications. Applications don't need to know whether this reliability is achieved through acknowledgments, retransmissions, or error-correcting codes. They simply use the interface to send data and trust that it will arrive correctly.
24+
25+
Services can be **connection-oriented** or **connectionless**. Connection-oriented services require establishing a connection before data transfer, like making a phone call. Connectionless services send data without prior setup, like mailing a letter. Both have valid use cases, and different layers may offer different service types.
26+
27+
Services can also be **reliable** or **unreliable**. Reliable services guarantee delivery (possibly through retransmission), while unreliable services provide "best effort" delivery. The choice depends on application requirements and the tradeoff between reliability and performance.
28+
29+
## The Reference Model Concept
30+
31+
A **reference model** is an abstract framework describing the layers of a network architecture. Reference models serve educational and standardization purposes—they help us understand networking concepts and provide a common vocabulary for discussing protocols.
32+
33+
The two most important reference models are:
34+
- The **OSI Reference Model**: A seven-layer theoretical framework developed by the International Organization for Standardization (ISO)
35+
- The **TCP/IP Model**: A four-layer practical model based on the Internet protocol suite
36+
37+
While these models differ in structure and philosophy, both embody the principles of layered architecture. Understanding both models provides complementary perspectives on network design.
38+
39+
## Benefits of Layered Design
40+
41+
Layered design has proven remarkably successful in networking. The Internet has grown from a small research network to a global infrastructure supporting billions of devices, largely because its layered architecture allowed incremental improvements without requiring complete redesigns.
42+
43+
**Technology independence**: Physical layer changes (from copper to fiber to wireless) don't require changes to upper layers. Applications written decades ago still work on modern networks.
44+
45+
**Protocol evolution**: New protocols can be developed at any layer. HTTP/2 and HTTP/3 improved application performance without changing transport or network layers. IPv6 was developed to extend addressing without changing application protocols.
46+
47+
**Troubleshooting**: Problems can be isolated to specific layers. If applications work over one network but not another, the issue is likely at the network layer or below.
48+
49+
**Education**: Layers provide a framework for understanding complex systems. Students can focus on one layer at a time, building understanding progressively.
50+
51+
## Limitations of Layered Design
52+
53+
Despite its benefits, layered architecture has limitations. **Layer violations** occur when protocols bypass their layer to optimize performance. For example, TCP implementations often examine IP header information for efficiency.
54+
55+
**Redundancy** can occur across layers. Multiple layers might perform error detection, leading to wasted effort. Some protocols attempt to reduce redundancy by trusting lower layers more fully.
56+
57+
**Protocol overhead**: Each layer adds headers (and sometimes trailers) to data, increasing the total amount of data transmitted. For small messages, header overhead can be significant.
58+
59+
**Abstraction penalties**: Sometimes the clean abstractions of layering prevent optimizations that would be possible with a more integrated design. Research into "cross-layer optimization" explores controlled violations of layer boundaries.
60+
61+
## Real-World Application
62+
63+
Understanding layered architecture helps in many practical situations:
64+
65+
**Troubleshooting**: When a network connection fails, systematically checking each layer often reveals the problem. Can you reach the local network (data link)? Can you reach the gateway (network)? Can you reach the server (transport)? Does the application respond correctly (application)?
66+
67+
**Design**: When building networked applications, understanding what services each layer provides helps you choose appropriate protocols and design efficient systems.
68+
69+
**Security**: Different threats target different layers. Physical security protects the physical layer, firewalls operate at network and transport layers, and application-layer security protocols like TLS protect application data.
70+
71+
The layered model isn't just theoretical—it's a practical tool for understanding, designing, and operating networks.

0 commit comments

Comments
 (0)