Huawei Data Communication Learning System Notes

Published 2026-08-21 07:02 Updated 2026-09-01 07:56 3964 words 20 min read

Network engineer data communication study notes

It has been too long since I last studied, so let me review. These are notes taken with reference to the study video

Huawei Data Communication

Network Models

OSI Model

  1. Application Layer (Layer 7)

    • Provides interfaces and services to applications
  2. Presentation Layer

    • Performs data format conversion, encryption and decryption, and image/text encoding
  3. Session Layer

    • Establishes, maintains, and terminates communication sessions
  4. Transport Layer

    • End-to-end transmission; responsible for ports and reliable/unreliable transmission
  5. Network Layer

    • Routing and addressing; determines the data path
  6. Data Link Layer

    • Transmission between adjacent devices, error checking, physical addressing
  7. Physical Layer (Layer 1)

    • Physical hardware, signal transmission; only transmits the bit stream of 0/1

TCP/IP Model

  1. Application Layer (Layer 4)

    • Combines the OSI application, presentation, and session layers. Faces users and programs

    • Protocols: HTTP (80), HTTPS (443), FTP (21), SSH (22), Telnet (23), SMTP (25), POM3 (110), IMAP (143), DNS (53), apps and browsers, etc.

  2. Transport Layer

    • End-to-end transmission; distinguishes programs by port

    • Protocols: TCP (065535) reliable, UDP (065535) efficient

    • 0~1023 are well-known fixed ports, 1024+ are dynamic custom ports

  3. Internet Layer (Internetwork Layer)

    • Routing and addressing; finds the destination host by IP address

    • Protocols: IP, ICMP

  4. Network Interface Layer (Network Layer)

    • Combines the OSI data link layer and physical layer; responsible for hardware transmission, MAC addressing, and cable/signal forwarding

    • Devices: network interface cards, switches, cables

TCP/UDP Packet Format

image.png
image.png

Ethernet Frame Format

image.png
image.png

ARP Address Resolution Protocol

image.png|445
image.png|445
ARP Principle
  1. HOST1 ARP cache
image.png
image.png
  1. ARP request
image.png
image.png
  1. HOST2 ARP cache — upon receiving, sends a unicast packet and saves it to the cache table
image.png
image.png
  1. ARP response — upon receiving, sends a unicast packet and saves it to the cache table
image.png
image.png
  1. HOST1 ARP response
image.png
image.png

IP Protocol

IPv4 Packet Format

image.png
image.png

Packet Fragmentation

  1. The process of dividing a packet into multiple fragments

  2. IP packets forwarded over the network can vary in length, but when a packet's length exceeds the maximum length of the data link layer, it must be divided into several smaller fragments for transmission

    • The data link layer has an MTU (Maximum Transmission Unit); Ethernet defaults to MTU=1500 bytes
Flag Bits
  1. Identification

    • All fragments split from the same original packet have identical identification values; the receiver uses it to determine which fragments belong to the same large packet
  2. Flags (3 bits, only the last 2 bits are used)

  3. MF bit (More Fragment)

    • 1 = there are more fragments after this one

    • 0 = this is the last fragment

    • The other bit: the Don't Fragment bit. When set to 1, fragmentation is not allowed; an oversized packet is dropped directly and an ICMP error message is returned

  4. Fragment Offset

    • 8 bytes

    • Indicates: how many 8-byte units the data portion of the current fragment is offset from the start of the original packet

    • Used for ordering and reassembly

    • Except for the last fragment, all other fragment lengths must be an integer multiple of 8 bytes

    • The fixed 20 bytes of the IP header (with no options field) must be excluded when calculating, i.e., 1480 bytes

  5. Each fragment has its own IP header (the header is unchanged, only the data is split)

  6. During routing and forwarding, fragments may travel over different paths and arrive out of order; the receiver relies on identification + fragment offset to sort and reassemble them

Fragment Offset=Total data bytes of all fragments before the current fragment8\text{Fragment Offset} = \frac{\text{Total data bytes of all fragments before the current fragment}}{8}

Time To Live (TTL)

image.png
image.png
  1. An 8-bit field in the IPv4 header. Values: 0~255

  2. Limits the maximum number of routing hops a packet can traverse; used to prevent loops

IP Classes

ClassLeading BitsFirst Octet Decimal RangeDefault Subnet MaskNetwork BitsHost BitsPrimary Use
A01 ~ 126255.0.0.0824Large networks
B10128 ~ 191255.255.0.01616Medium networks
C110192 ~ 223255.255.255.0248Small LANs
D1110224 ~ 239———Multicast
E1111240 ~ 255———Research / Reserved
Private IP addresses that can be freely used on the intranet, not consuming public addresses:
  • Class A private range: 10.0.0.0 ~ 10.255.255.255

  • Class B private range: 172.16.0.0 ~ 172.31.255.255

  • Class C private range: 192.168.0.0 ~ 192.168.255.255

Routing

image.png
image.png

Route Acquisition Methods

  1. Directly connected routes

    1. Automatically generated when devices are connected; priority 0, the highest
  2. Static routes

    1. Manually configured; default priority 60
  3. Dynamic routes

    1. Devices automatically exchange route information with each other

    2. Self-learning, self-updating

    3. OSPF routes

      1. Internal route priority 10

      2. External route priority 150

Static route configuration rule:

ip route-static {next-hop IP | outgoing interface | next-hop + outgoing interface}

Equal-Cost Routes

Definition: For the same destination network, multiple routes have exactly equal cost metrics, and the router forwards traffic across multiple links simultaneously
When the following three conditions are met, the routing table generates multiple route entries at the same time, enabling equal-cost load sharing. Prerequisites:

  1. The destination IP network is the same

  2. The cost calculated by the routing protocol is the same

  3. The next hops and outgoing interfaces differ (two or more different physical paths exist)

Floating Static Routes

Definition: For the same destination network, two static routes are configured; the primary route has a higher priority, while the backup route with a lower priority does not enter the routing table. When the primary link fails, the backup automatically takes over
Key points:

  1. Huawei / H3C: the smaller the priority value, the more preferred; Cisco is also the smaller the more preferred

  2. Default static priority is 60

  3. Floating backup route setting: 61~255 (the larger, the lower the priority)

OSPF

Definition

Definition: Open Shortest Path First, a classless inter-domain routing protocol, belonging to the IGP (Interior Gateway Protocol) and link-state routing protocols. Based on the SPF algorithm

  1. Protocol number: 89

  2. Multicast addresses: 224.0.0.5 (all OSPF routers), 224.0.0.6 (DR/BDR)

  3. Features: classless, supports VLSM, supports route summarization, fast convergence, loop prevention; suitable for medium-to-large campus / carrier intranets

  4. LSDB (Link-State DataBase): the "whole-network topology map" shared by all routers within the same OSPF area, storing all LSA entries of the area.

image.png
image.png

OSPF Principles

  1. A link-state IGP protocol with IP protocol number 89; routers do not exchange routes directly with each other, but send each other LSA (link-state advertisement) messages describing links, costs, and neighbors

  2. Routers within the same area fully synchronize an identical LSDB (link-state database)

  3. Neighbors discover and maintain each other through Hello packets; after negotiation succeeds, LSAs are exchanged, and the LSDB reaches a Full adjacency

  4. Each router runs the SPF algorithm rooted at itself, independently computing the shortest paths based on the LSDB to generate its routing table

  5. Areas are divided into the backbone Area 0 and non-backbone areas; the purpose is to reduce the scope of LSA flooding; ABRs are responsible for inter-area route propagation

  6. Broadcast networks elect DR/BDR to reduce the number of adjacencies

  7. Cost is used as the metric, defaulting to 10^8/interface bandwidth

  8. Different types of LSA handle inter-area, intra-area, and external routes; LSAs are flooded within their specified scope

The Functions and Establishment Process of OSPF's 8 States

State order: Down → Attempt → Init → 2‑Way → ExStart → Exchange → Loading → Full

Among them, Attempt appears only in NBMA networks (Frame Relay)

The complete interaction of the 8 states is as follows:

  1. Down

    • If no Hello packet has been sent yet, it remains in the Down state
  2. Attempt

    • Neighbors are manually configured; Hello packets are sent by unicast, waiting for a response from the peer
  3. Init

    • After receiving a Hello packet, OSFP starts running and enters the Init state

    • Mainly to discover the peer and learn its link information, cost, neighbor information, etc.

    • For example: R1 sends a Hello packet to R2; R2 receives the Hello packet, sees the peer's Router-ID in it, and after learning the peer's relevant information, R2 replies with a Hello packet, writing R1's RID and related information into its neighbor list; R1 receives the packet, sees its own RID in the neighbor list, and enters 2-Way; at this point R1 also needs to send a Hello packet carrying R2's RID; R2 receives the packet, sees its own RID, and R2 enters 2-Way

    • This process requires both sides to receive each other's Hello packets; a bidirectional neighbor relationship is established

    • Router‑ID is just an identity; the neighbor list field is the credential for bidirectional confirmation.

  4. 2-Way

    • Received a Hello packet, and the neighbor list in the Hello packet contains itself: bidirectional connectivity is established, and the neighbor relationship is formed.

    • After 2-Way, broadcast networks perform DR/BDR election; p2p networks skip it

    • Routers that are neither DR (Designated Router) nor BDR (Backup Designated Router) are called DRother

    • DRothers stay only at 2‑Way and do not proceed further

    • Devices that need to establish adjacency enter ExStart, e.g., DRother ↔ DR; DRother ↔ BDR

  5. ExStart

    • After entering ExStart, LSDB synchronization begins; DBD packets are exchanged to elect the master/slave, typically the device with the larger Router‑ID becomes the master; it controls the DBD packet sequence numbers. Only master/slave is negotiated; no LSA summaries are exchanged.

    • After the master/slave is confirmed, it enters ExChange

  6. ExChange

    • After entering ExChange, DBD packets carrying LSA summaries are exchanged. Each side tells the other which LSAs are in its LSDB; only LSA summaries are passed, not complete LSAs
  7. Loading

    • Comparing DBD summaries, when a router finds it lacks certain LSAs, it starts sending LSR packets to request the complete LSAs

    • The peer replies to the LSR request with LSU packets (carrying the complete LSAs); after receiving them, it also replies with LSAck acknowledgments

    • Repeatedly request, update, and acknowledge

  8. Full

    • When all LSAs are synchronized and the LSDB databases are consistent, the SPF algorithm starts running to compute routes, and the adjacency completes, entering the Full state

    • A complete OSPF routing table is generated. Note: each router has its own global routing table; neighbors do not pass route entries to each other, only LSA topology, and each computes its own routes. Among them, the LSA aging time is one hour

    • When there is no failure, Hello (10s) packets maintain the relationship; a Hello is sent every 10 seconds to ensure the neighbor is still alive

    • When four consecutive Hello packets go unanswered, there is a Dead Time of 40 seconds timer, i.e., the maximum allowed timeout for the neighbor: four Hello packet intervals. When the timer expires, the neighbor is judged to have failed; the neighbor and all LSAs learned from it are deleted, SPF computation restarts, and the state is reset to Down

    • When the network changes, an LSA with an updated version number is generated and flooded across the entire network using LSU packets; however, different LSA types have restricted propagation scopes, flooding only within the corresponding scope each LSA can reach — see the LSA classification for details

      • Routers receiving the LSU compare it against their LSDB, update their local LSDB, and reply with LSAck acknowledgment

      • Trigger SPF recalculation (not a full recomputation) to refresh the OSPF routing table

      • The neighbor state remains Full and does not fall back to ExStart; it only regresses when the neighbor fails and disconnects

OSPF Areas

The concept of area division: if the entire network is not divided and only Area 0 exists, all devices would share a single LSDB, making the network too large; it would also produce a huge number of LSAs, causing repeated full-network SPF runs and frequent network flapping

LSA Classification

NumberCommon NameLSA NameGeneratorFlooding ScopeCore Function
Type‑1Type 1 LSARouter LSAEvery router in the areaLocal areaDescribes all directly connected links and costs of the router; source of intra-area routes
Type‑2Type 2 LSANetwork LSADR of the broadcast segmentLocal areaDescribes broadcast / NBMA multi-access segments, listing all routers on the segment
Type‑3Type 3 LSASummary‑Network LSAABROther areasPropagates routes between different areas, inter-area routes O IA; supports route summarization
Type‑4Type 4 LSASummary‑ASBR LSAABROther areasAdvertises the Router‑ID location of the ASBR router, serving Type 5 external routes
Type‑5Type 5 LSAAS‑External LSAASBREntire OSPF ASIntroduces external routes (static, other protocols); E1/E2 two metrics
Type‑6Type 6 LSAGroup‑Membership LSAMOSPF routerLocal areaUsed by MOSPF multicast OSPF; not used by ordinary unicast OSPF
Type‑7Type 7 LSANSSA‑External LSAASBR within the NSSA areaNSSA area onlyNSSA area introduces external routes; NSSA‑ABR converts Type 7 to Type 5 LSAs; N1/N2
Type‑8Type 8 LSAExternal‑Attribute LSAASBREntire ASCarries external route attributes such as BGP; barely used in live networks
Type‑9Opaque LSA #9Opaque‑LSA (link-local)RouterLocal link onlyExtension features; cannot flood across routers
Type‑10Opaque LSA #10Opaque‑LSA (area scope)RouterLocal areaMPLS‑TE, Segment Routing; floods within the local area
Type‑11Opaque LSA #11Opaque‑LSA (entire AS)RouterEntire AS domainExtensions such as SR; floods across the whole OSPF domain

Backbone Area

Area 0 definition:

  1. Exists and is unique; the backbone area

  2. All normal areas must be directly connected to Area 0; areas cannot be daisy-chained onto other areas (Area 1 connecting to Area 2 without connecting to Area 0 is an incorrect topology)

  3. Non-backbone areas that are isolated and cannot directly connect to Area 0 must configure a virtual link Virtual-link to reach the backbone

Area 0 function: after each area's routes are summarized, they are forwarded through the backbone, acting as the high-speed backbone of the entire OSPF network

Non-Backbone Areas

Areas 1 through N are non-backbone areas
Features: when the topology changes in this area, LSAs do not leave the area, and other LSDBs are not affected

IR (Internal Router) definition: all interfaces are entirely within the same Area (all in Area 0 or all in Area 1), without crossing areas
ABR (Area Border Router) definition: one side is Area 0 and the other is a normal area; generates Type 3 summary LSAs; responsible for inter-area routes
ASBR (Autonomous System Boundary Router) definition: when an ABR device introduces external routes such as static routes, RIP, BGP, it becomes an ASBR; generates Type 5 LSAs (NSSA generates Type 7, converted to Type 5 when leaving the area)

Special Areas

Normal standard area: Types 1, 2, 3, 4, 5 LSAs all exist
Special areas are used to block external Types 4 and 5 LSAs; the ABR automatically advertises a default route to replace the huge number of specific routes

Reference detail table:

+++ info\

Special Area TypeLSAs Allowed to KeepLSAs ForbiddenCore Optimization Effect
Normal standard areaAll of Types 1/2/3/4/5NoneFull routing capability, no optimization
Stub areaTypes 1/2/3 (detailed) + default Type 3 route advertised by ABRATypes 4 and 5 external LSAsBlocks a large number of external routes from outside the domain, streamlining the LSDB
Totally Stub areaTypes 1/2 + default Type 3 route advertised by ABRType 3 (detailed), Types 4, 5Extremely streamlined LSDB, keeping only intra-area topology + default exit route
NSSA areaTypes 1/2/3 (detailed) + local Type 7 external LSAs + default Type 3 route advertised by ABRIncoming external Types 4 and 5 LSAsBlocks external routes from outside the domain while allowing the area to introduce local external routes
Totally NSSA areaTypes 1/2 + local Type 7 external LSAs + default Type 3 route advertised by ABRType 3 (detailed), incoming Types 4, 5Extremely streamlined + local external network access capability; first choice for branch sites
;;;
Area TypeLSAs PresentCharacteristics
Standard normal area1, 2, 3, 4, 5Has Types 4 and 5, no Type 7
Stub1, 2, 3 (no 4, 5)No 4 or 5; ABR advertises a default Type 3
Totally Stub1, 2 + default Type 3No detailed Type 3, no 4 or 5
NSSA1, 2, 3, 7 (no incoming 4, 5)Has Type 7; no external Type 5 enters the area
Totally NSSA1, 2, 7 + default Type 3No detailed Type 3, no incoming 4 or 5
;;;
+++
Stub Area
  1. Removed: Types 4 and 5 LSAs; keep Types 1, 2, 3

  2. The ABR advertises a default Type 3 route

  3. No ASBR is allowed; no external routes can be introduced, so there is neither Type 5 nor Type 7

Totally Stub Area
  1. Removed: Type 3 (except the default), Types 4 and 5 LSAs; only Types 1 and 2 + a default route remain

  2. Small LSDB; first choice for branch sites

NSSA Area
  1. An ASBR may exist, and the area is allowed to introduce external routes (generating Type 7 LSAs)

  2. Filters external Types 4 and 5 LSAs; the ABR advertises a default route

  3. The ABR converts Type 7 LSAs into Type 5 LSAs and sends them to the backbone area and other areas; Type 7 can only flood within the NSSA area and cannot leave the NSSA

Totally NSSA Area
  1. Removed: Type 3 (except the default), Types 4 and 5 LSAs; local external Type 7 LSAs are kept

  2. Optimal: the first choice when small branches need external network access and streamlined routing

Distance Vector

  1. Sends the routing table to neighbors, and neighbors compute routes based on that table; it is "hearsay" — trusting what the neighbor says

  2. Representative protocols: RIP, IGRP, EIGRP (Cisco)

  3. RIP has a maximum of 15 hops; 16 hops is unreachable. Advantages: simple configuration, small memory footprint, suitable for small networks. Disadvantages: prone to loops — the repeated sending of the routing table wastes bandwidth; hop count is used as the metric, ignoring link bandwidth, so high- and low-speed links incur the same cost and route selection is unreasonable

  1. Only sends information about its own directly connected links; each router across the network draws the shortest paths independently, which is "actual measurement" — each draws its own map in real time

  2. Representative protocols: OSPF, IS-IS

  3. Advantages:

    1. Almost no routing loops; LSA flooding (link-state advertisement) is sent only when links change, and incremental updates save bandwidth

    2. Bandwidth, delay, etc. are used as metrics, giving precise route selection; suitable for large networks

  4. Disadvantages:

    1. High resource consumption; demanding device requirements

    2. Complex configuration; requires dividing areas: Area, DR/BDR, etc.

How Switches Work

Layer 2

  1. MAC learning — when a switch receives a data frame, it reads the source MAC address in the frame header:
  • If the MAC address table does not have this MAC, write "receiving port + source MAC" into the MAC address table;

  • If it already exists, update the corresponding port and aging time;

Only the source MAC is used for learning; the destination MAC is used to decide forwarding.

  1. Frame forwarding/unicast — take the destination MAC address of the frame and look it up in the MAC address table:
  • ✅ MAC found in the table: forward directly out the corresponding port, not to other ports (isolating traffic).

  • ❌ MAC not found in the table: perform flooding (broadcast forwarding), forwarding the frame to all ports except the receiving port.

  1. Broadcast/multicast frames
    When the destination MAC is the broadcast address FF‑FF‑FF‑FF‑FF‑FF, the switch directly floods to all ports, and all ports receive the broadcast.

  2. Aging and deletion
    MAC address table entries have an aging time (default 300 seconds); if no packets from the device are received for a long time, the entry is automatically deleted to prevent table overflow.

Layer 3

Layer 2 only looks at MAC; Layer 3 switches add IP routing capability and can perform inter-VLAN forwarding based on IP.

::: success
Study tip: learn from the source MAC, look up the destination MAC; if found, unicast forward, if not found, flood; broadcast frames go to all ports, and entries aged out on timeout are deleted.
:::

VLAN

The core idea is that devices in the same broadcast domain can communicate; the main port types are access, trunk, and hybrid
Used to prevent broadcast domains from growing too large and to isolate broadcast domains

  1. access: mainly connects to end devices; it strips the tag before sending frames to the end device

  2. trunk: mainly connects to the same type of device; it carries VLAN tags when sending frames to other switches and allows multiple VLANs to pass. Only the PVID (native VLAN) strips the tag

  3. hybrid: combines the features of access and trunk; you can manually specify which VLANs are tagged and which are stripped. Highly flexible

::: info
pvid vs. vid
port vlan id and vlan id, literally: vid is the VLAN's own number and belongs to the data frame; pvid is a port parameter — the VLAN number the port assigns to untagged frames — and belongs to the port configuration

  1. Access PVID = the VID of the port's VLAN; when an untagged frame is received, it is tagged with this VID; when sent out, the tag of this VID is stripped.

  2. Trunk PVID is the port's native VLAN; frames of the VID corresponding to the PVID have the tag stripped when sent; other VIDs keep their tags.

  3. Hybrid The PVID is still used to tag untagged frames; whether to strip tags does not depend on the PVID — manual commands specify whether each VID is untagged

:::

If you enjoyed this, leave a comment~

... Page views
© 2021 - 2026 Vullfin @VV
Powered by theme astro-koharu · Inspired by Shoka