Home About Me

Last-Minute Computer Networks Review for a Freshman Exam

This is a compact pre-exam review of the main computer networking basics, with the focus kept on the concepts that are easy to test and easy to mix up.

What a computer network is

A computer network is a system made up of interconnected computers. Through data communication links, computers at different distances can share resources and exchange information under certain protocols, network systems, and management software.

Bandwidth

Bandwidth refers to the ability of a network or communication channel to carry data. It is usually measured in bits per second (bps). In simple terms, bandwidth determines how fast a network or communication link can transmit data.

Transmission media

Wired media: - Coaxial cable - Twisted pair - Optical fiber

(There are also wireless channels, but they were not covered here.)

Data communication modes

  1. Simplex
  2. Half-duplex
  3. Full-duplex

The OSI/RM seven-layer model

From top to bottom: - Application layer - Presentation layer - Session layer - Transport layer - Network layer - Data link layer - Physical layer

In this model, sending goes from the upper layers downward, while receiving goes from the lower layers upward.

The TCP/IP model

The TCP/IP model includes: - Application layer - SMTP -> email protocol - HTTP -> hypertext transfer protocol - Telnet -> network terminal protocol - FTP -> file transfer protocol - NNTP -> network news transfer protocol - DNS -> domain name system - SNMP -> simple network management protocol - RIP/OSPF -> routing information protocol - Transport layer - Internetwork layer - Host-to-network layer (network interface layer)

Compared with the OSI/RM model, the four-layer TCP/IP model is generally considered more efficient and more practical, though the overall functions of the two models are broadly similar.

IP, TCP, and UDP

IP is the Internet Protocol. It is the set of rules used to transmit data between different devices in network communication.

TCP is the Transmission Control Protocol. It provides reliable, connection-oriented communication. Reliability is achieved through mechanisms such as acknowledgments and retransmission.

UDP is the User Datagram Protocol. It is connectionless and does not provide the same reliability as TCP. Its emphasis is on speed and simplicity. Many in-game online communication methods are based on UDP.

IP addresses and their structure

An IP address is divided into two parts: - Network number on the left - Host number on the right

Traditional classful addressing is divided into A, B, and C classes:

  • Class A
    Maximum number of networks: 126
    Maximum number of hosts: 16777214
    Range: 1.0.0.0 - 126.255.255.255

  • Class B
    Maximum number of networks: 16382
    Maximum number of hosts: 65534
    Range: 128.0.0.0 - 191.255.255.255

  • Class C
    Maximum number of networks: 2097150
    Maximum number of hosts: 254
    Range: 192.168.0.0 - 223.255.255.255

When assigning host addresses, one address is occupied by the gateway and one by broadcast, so in practice the usable range is reduced accordingly: the smallest usable address increases by one, and the largest usable address decreases by one.

Broadcast can be divided into direct broadcast, global broadcast, and local broadcast (limited broadcast), with 255.255.255.255 being the limited broadcast address.

Subnetting

Subnetting means borrowing bits from the host portion.

For example, if 192.168.1.0/24 is divided into three subnets, the subnet mask becomes /27. In binary:

  • Original /24 mask:
    11111111.11111111.11111111.00000000
  • After borrowing bits for /27:
    11111111.11111111.11111111.(111)00000

The borrowed bits are taken from left to right in the host part. Converting /27 to decimal gives:

  • 255.255.255.224

Each subnet then has 62 usable host addresses.

For example, in 192.168.1.0/27, addresses such as: - 192.168.1.1 - 192.168.1.62 - 192.168.1.65 - 192.168.1.126

can be assigned to hosts.

Converting between gateway, subnet mask, and network address

You first need an IP address, which should normally be given in the problem.

Finding the network address

When you have only the IP address and subnet mask: - Keep the bits where the subnet mask is all 1s - Set the other bits to 0 - Perform a logical AND with the IP address

On that basis, the address where the host bits are all 1s is the broadcast address.

Finding the subnet mask without subnetting

Use the default mask. For example, an address starting with 192 is Class C, so the default mask is: - 255.255.255.0

Finding the subnet mask with subnetting

The note here only mentions using logical AND for calculation, but the rest was left unfinished.

The three-layer LAN architecture (standard structure)

  1. Physical layer
  2. Media Access Control layer (MAC)
  3. Logical Link Control layer (LLC)

IEEE 802.3 media access control method: CSMA/CD

Chinese name: 带有冲突检测的载波侦听多路存取
English name: Carrier Sense Multiple Access/Collision Detection

This is a media access control method from IEEE.

The basic idea of CSMA/CD is: - All nodes share the transmission channel - Before sending data, a node first checks whether the channel is idle - If the channel is idle, it sends; otherwise, it waits - After transmission starts, it continues checking for collisions - If a collision is detected, transmission is canceled

Ethernet physical layer standards

  • 10BASE2: uses coaxial cable, distance 200 meters
  • 10BASE-T: uses twisted pair, transmission rate 10 Mbps
  • 100BASE-TX: also uses twisted pair, transmission rate 100 Mbps
  • 1000BASE-T (Gigabit Ethernet): still uses twisted pair, transmission rate 1 Gbps
  • 10GBASE-T: uses higher-grade twisted pair, transmission rate 10 Gbps
  • 100BASE-FX: uses optical fiber, transmission rate 100 Mbps
  • 1000BASE-SX/LX: uses optical fiber, for short-distance and long-distance transmission respectively, at 1 Gbps
  • 10GBASE-SR/LR: optical fiber transmission at 10 Gbps, where SR is for short distance and LR is for long distance

If the distance is not specified for twisted pair, assume the default is 100 meters.

How a switch works

The original explanation is often too long, so here is the direct exam-oriented version.

Frame reception: When a switch receives a frame, it checks the destination MAC address.

Address learning: The switch records the MAC address of the sending device and stores the mapping between that MAC address and the interface (port) in its MAC address table.

Frame filtering and forwarding: By looking up the MAC address table, the switch determines which interface the destination device is on and forwards the frame only to that interface instead of broadcasting it to all ports.

Broadcast and unknown destination handling: If the destination MAC address is not found in the address table, the switch broadcasts the frame to all other ports while also recording the new MAC address. This helps complete the address table over time.

Collision domain separation: Unlike a hub, a switch creates separate collision domains for different ports through virtual connections, which helps avoid data collisions.

Practical commands (eNSP command collection)

sys/system-config(进入配置模式)
int g0/0/0(进入端口)
ip add 192.168.1.1 24/ip address 192.168.1.1 24(配置网关为192.168.1.1,子网掩码为24位)
ip route-static 目的地址 掩码 下一跳地址(也就是下一个路由)
q/quit(退出)
save(保存)
reboot(重启)
shutdown(关闭端口)
undo shutdown(启动端口)
sysname R1(在配置界面改名)
display this(查看配置的命令)
display ip routing-table(查看路由表)

Console configuration method

user-interface console 0(进入控制台端口)
authentication-mode password(设置为密码登录)
set authentication password cipher 密码(设置用户)
user privilege level 级别(1-15) (配置用户的级别)
aaa模式(设置对应用户级别)
aaa
local-user admin privilege level 15