Home Blog Certs Knowledge Base About

LPIC-1 109.1 โ€” Fundamentals of Internet Protocols

Exam weight: 4 โ€” LPIC-1 v5, Exam 102

What You Need to Know

From the official LPIC-1 objectives:

  • Demonstrate an understanding of network masks and CIDR notation.
  • Knowledge of the differences between private and public “dotted quad” IP addresses.
  • Knowledge about common TCP and UDP ports and protocols (20, 21, 22, 23, 25, 53, 80, 110, 123, 139, 143, 161, 162, 389, 443, 465, 514, 636, 993, 995).
  • Knowledge about the differences and major features of UDP, TCP, and ICMP.
  • Knowledge of the major differences between IPv4 and IPv6.
  • Knowledge of the basic features of IPv6.

Key files and commands: /etc/services.


IPv4 Addressing

IPv4 addresses are 32-bit numbers written as four decimal octets separated by dots (e.g., 192.168.1.100).

Address Classes

ClassFirst Octet RangeDefault PrefixPurpose
A1โ€“126/8Large networks
B128โ€“191/16Medium networks
C192โ€“223/24Small networks
D224โ€“239โ€”Multicast
E240โ€“255โ€”Reserved/experimental
โ€”127.0.0.0/8โ€”Loopback (127.0.0.1)

Private (RFC 1918) Ranges

These addresses are not routed on the public internet and require NAT to communicate externally.

RangeCIDRClass
10.0.0.0 โ€“ 10.255.255.25510.0.0.0/8A
172.16.0.0 โ€“ 172.31.255.255172.16.0.0/12B
192.168.0.0 โ€“ 192.168.255.255192.168.0.0/16C

Subnet Masks and CIDR

A subnet mask defines which bits of an address identify the network and which identify the host.

  • /24 = 255.255.255.0 โ€” 256 addresses, 254 usable hosts
  • /25 = 255.255.255.128 โ€” 128 addresses, 126 usable hosts
  • Usable hosts = 2โฟ โˆ’ 2, where n is the number of host bits

Network address: all host bits set to 0 (first address in range).
Broadcast address: all host bits set to 1 (last address in range).

Example: 192.168.1.0/24 โ†’ network 192.168.1.0, broadcast 192.168.1.255, usable 192.168.1.1โ€“192.168.1.254.

Special Addresses

  • Default route: 0.0.0.0/0 โ€” matches any destination; used as the gateway of last resort.
  • NAT (Network Address Translation): allows multiple hosts with private IPs to share a single public IP.
  • TTL (Time to Live): decremented by each router; packet dropped when TTL reaches 0, preventing routing loops.

Common Ports and Protocols

PortProtocolService
20TCPFTP data
21TCPFTP control
22TCPSSH
23TCPTelnet
25TCPSMTP
53TCP/UDPDNS
80TCPHTTP
110TCPPOP3
123UDPNTP
139TCPNetBIOS
143TCPIMAP
161UDPSNMP
162UDPSNMP Trap
389TCPLDAP
443TCPHTTPS
465TCPSMTPS
514TCP/UDPRSH / Syslog
636TCPLDAPS
993TCPIMAPS
995TCPPOP3S

The file /etc/services maps service names to port numbers and protocols.


Transport Layer Protocols

TCP โ€” Transmission Control Protocol

  • Connection-oriented: establishes a connection before data transfer via the 3-way handshake (SYN โ†’ SYN-ACK โ†’ ACK).
  • Reliable: guarantees delivery, order, and error checking.
  • Used by HTTP, HTTPS, SSH, SMTP, FTP.

UDP โ€” User Datagram Protocol

  • Connectionless: sends datagrams without establishing a connection.
  • Unreliable: no delivery guarantees.
  • Lower overhead; used where speed matters more than reliability (DNS queries, NTP, streaming).

ICMP โ€” Internet Control Message Protocol

  • Not a transport protocol; carries control and diagnostic messages.
  • Used by ping (echo request/reply) and traceroute.
  • No ports; operates at the network layer.

IPv6

IPv6 addresses are 128-bit numbers written as eight groups of four hexadecimal digits separated by colons:

2001:0db8:0000:0000:0000:0000:0000:0001

Abbreviation Rules

  1. Drop leading zeros within each group: 0db8 โ†’ db8, 0001 โ†’ 1.
  2. Replace one sequence of consecutive all-zero groups with :: (only once per address).
2001:db8::1
fe80::1
::1       (loopback)

Address Types

TypeDescription
Global unicast2000::/3 โ€” publicly routable
Link-local unicastfe80::/10 โ€” not routed beyond a link
Loopback::1
Multicastff00::/8
AnycastOne address shared by multiple interfaces; nearest responds

Key Differences from IPv4

FeatureIPv4IPv6
Address size32-bit128-bit
BroadcastYesNo (multicast used instead)
Address configDHCP or staticSLAAC, DHCPv6, or static
Hop limitTTL fieldHop Limit field
ARPYesReplaced by NDP (Neighbor Discovery Protocol)
URL notationhttp://192.168.1.1/http://[::1]/ (brackets required)

Quick Reference

IPv4 classes:
  A: 1โ€“126     /8    private: 10.0.0.0/8
  B: 128โ€“191   /16   private: 172.16.0.0/12
  C: 192โ€“223   /24   private: 192.168.0.0/16
  loopback: 127.0.0.1

CIDR: /prefix โ€” host bits = 32-prefix; usable hosts = 2^n - 2
  network addr = host bits all 0
  broadcast    = host bits all 1

Default route: 0.0.0.0/0   NAT   TTL

Key ports:
  20/21 FTP   22 SSH    23 Telnet   25 SMTP    53 DNS
  80 HTTP     110 POP3  123 NTP     139 NetBIOS 143 IMAP
  161 SNMP    162 SNMPTRAP  389 LDAP  443 HTTPS  465 SMTPS
  514 RSH/Syslog  636 LDAPS  993 IMAPS  995 POP3S

/etc/services โ€” maps service names to port/protocol

TCP: connection-oriented, reliable (SYN/SYN-ACK/ACK)
UDP: connectionless, unreliable, low overhead
ICMP: control messages, ping/traceroute, no ports

IPv6:
  128-bit, 8 groups of 4 hex digits
  Abbreviation: drop leading zeros; :: replaces one run of all-zero groups
  fe80::/10 link-local   ::1 loopback   ff00::/8 multicast
  No broadcast; SLAAC; Hop Limit; NDP replaces ARP
  Brackets in URLs: http://[::1]/

Exam Questions

  1. What is the default subnet mask for a Class B address? โ†’ /16 (255.255.0.0)
  2. Which private range belongs to Class A? โ†’ 10.0.0.0/8
  3. What is the broadcast address for 192.168.5.0/24? โ†’ 192.168.5.255
  4. How many usable hosts fit in a /26 subnet? โ†’ 62 (2โถ โˆ’ 2)
  5. What does the default route 0.0.0.0/0 represent? โ†’ The route of last resort; matches any destination.
  6. What port does HTTPS use? โ†’ 443
  7. What port does SMTP use? โ†’ 25
  8. What port does DNS use? โ†’ 53 (TCP and UDP)
  9. What port does SNMP Trap use? โ†’ 162/UDP
  10. What file maps service names to port numbers? โ†’ /etc/services
  11. What is the key difference between TCP and UDP? โ†’ TCP is connection-oriented and reliable; UDP is connectionless and unreliable.
  12. What protocol does ping use? โ†’ ICMP
  13. What is the loopback address in IPv6? โ†’ ::1
  14. What IPv6 prefix is used for link-local addresses? โ†’ fe80::/10
  15. What replaces ARP in IPv6? โ†’ NDP (Neighbor Discovery Protocol)
  16. How are IPv6 addresses abbreviated? โ†’ Drop leading zeros per group; replace one run of consecutive all-zero groups with ::.
  17. How is an IPv6 address written in a URL? โ†’ Enclosed in brackets: http://[2001:db8::1]/
  18. What does SLAAC stand for? โ†’ Stateless Address Autoconfiguration โ€” allows a host to configure its own IPv6 address without DHCP.

Exercises

Exercise 1 โ€” Subnetting

A network administrator uses 172.16.10.0/28. What is the broadcast address and how many usable hosts are available?

Answer

/28 means 28 network bits, 4 host bits. 2โด = 16 addresses.

Network: 172.16.10.0
Broadcast: 172.16.10.15
Usable hosts: 14 (addresses 172.16.10.1 through 172.16.10.14)


Exercise 2 โ€” Private Range Identification

Classify these addresses as private or public: 10.0.0.1, 172.15.0.1, 172.16.0.1, 192.168.100.1, 8.8.8.8.

Answer
  • 10.0.0.1 โ€” private (10.0.0.0/8)
  • 172.15.0.1 โ€” public (172.15.x.x is outside 172.16.0.0/12)
  • 172.16.0.1 โ€” private (172.16.0.0/12)
  • 192.168.100.1 โ€” private (192.168.0.0/16)
  • 8.8.8.8 โ€” public

Exercise 3 โ€” IPv6 Abbreviation

Abbreviate the address 2001:0db8:0000:0000:0001:0000:0000:0001.

Answer
  1. Drop leading zeros per group: 2001:db8:0:0:1:0:0:1
  2. Replace longest run of consecutive zero groups with ::: 2001:db8::1:0:0:1

The two trailing zero groups (0:0) are shorter than the pair in positions 3โ€“4, so the replacement is applied to the earlier run.


Exercise 4 โ€” Protocol Selection

You are writing a real-time video streaming application where occasional lost packets are acceptable but low latency is critical. Which transport protocol should you use?

Answer

UDP โ€” it is connectionless and has lower overhead. Lost packets are not retransmitted, which is acceptable for streaming where latency matters more than perfect reliability.


Exercise 5 โ€” Port Lookup

What command would look up the port number for the imaps service?

Answer
grep imaps /etc/services

Output will show imaps 993/tcp.


LPIC-1 Study Notes | Topic 109: Networking Fundamentals