本文是我在上UCSD的 CSE 120: Principles of Operating Systems (Winter 2020) 整理的笔记,这一课主要介绍了网络的概念,包括网络的类型和协议的概念。并且简单介绍了一下OSI7层模型,包括addressing和routing的过程。
Basics
What is a Network?
Network
- Set of computing nodes
- Connected by communication links
- Allow data transfer by a sender to a receiver
Internetwork: a network of networks
- The “Internet” is a global internetwork
- Nodes communicate using IP (Internet Protocol)
Types of Networks
Circuit-switch vs. Packet switching
Protocol
What is protocol?
- Goal: get message from sender to receiver
Protocol
- agreed message format and transfer procedure
Multiparty, so no central thread of control
- Sender and reciver are separate processes
Expectations of operation
- first you do x, then I do y, then you do z,…
- If you do q, I’ll do p
Message
Message: contains header and data
- Similar terms: packet, datagram, frame
Data: what sender wants to receiver to know
Header: information to support protocol
- Source and destination addresses
- State of protocol operation
- Error control (to check intergity of received data)
Example:
Summary (Layering: Separation of Functions)
Ann and Bob
- Don’t have to know about delivery
- However, aid postal system by providing addresses
Postal System
- Only has to know addresses and how to deliver
- Doesn’t care about “data”: Ann, Bob, letter
7 Layers of OSI (Open Systems Interconnection) Refernce Model
layer | name | function |
---|---|---|
7 | Application | application protocol, e.g., HTTP |
6 | Presentation | syntax, network format |
5 | Session | start/stop/manage connections |
4 | Transport | segment, reliability, flow control |
3 | Network | logical addressing, routing |
2 | Link | physical addressing, framing |
1 | Physical | 0’s and 1’s over a wire |
Internet Protocol Stack
- “Hourglass” design
- Application: Email, Web
- Session: sockets
- Transport: TCP, UDP, …
- Network: IP (Only one kind of protocol in this layer, which makes Internet Internet!)
- Link: Ethernet, ATM, …
- Physical
Encapsulation
- Higher level n with lower level n - 1
- Can also have level within a level: tunneling
- Multiplexing and de-multiplexing
Addresses
Generally, three levels of addresses
- Domain names: cs.ucsd.edu
- Logical addresses (IP): 128.53.27.92
- Physical addresses (Ethernet): 0x27A5BB17019D
Address resolution
- Mapping higher level name to lower level name
- Techniques: table lookup, formula, protocol
Sizes of address spaces
IPv4 (version 4, current/past)
- 32 bit addresses
= 4 billion addresses
IPv6 (version 6, future/current)
- 128 bit addresses
Routing
Scalability
How well does system grow
- in terms of performance, reliability, etc
Ramifications of adding node or link
- Local effects vs. global effects
Information growth: import to reduce
- Amount stored at nodes
- Amount exchanged between nodes
Error Control
- Parity: even, odd, two-dimesional
- CRC (cyclic redundance code)
- Checksum
- Automatic repeat request (ARQ)
v1.5.2