Computer Networks Flashcards - Lecture 3: ip and subnetting

0.0(0)
studied byStudied by 1 person
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/75

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

76 Terms

1
New cards

What are the three key functions of the network layer?

(1) At sending host: encapsulates transport-layer segments into datagrams, (2) At routers: forwards datagrams based on destination addresses, (3) At receiving host: extracts segments and delivers to transport layer

2
New cards

What are the three main network layer protocols?

(1) IP Protocol - defines datagram format, addressing, packet handling, (2) ICMP Protocol - error reporting and router signaling, (3) Routing Protocols - OSPF (intra-domain), BGP (inter-domain)

3
New cards

What is an IP datagram?

An IP packet consisting of a header (typically 20 bytes, up to 60 with options) and a payload (usually a TCP or UDP segment)

4
New cards

What does the Version field (4 bits) in the IP header indicate?

Specifies the IP version: IPv4 = 4 (binary 0100), IPv6 = 6 (binary 0110); router checks this first to know how to process the packet

5
New cards

What does the Header Length field (4 bits) specify?

Length of IP header in 32-bit words; minimum value is 5 (20 bytes), maximum is 15 (60 bytes); variable because of optional fields

6
New cards

What is the range of the Total Length field (16 bits)?

20 bytes (header only) to 65,535 bytes maximum; however, most networks have smaller MTU (typically 1500 bytes for Ethernet)

7
New cards

What is MTU?

Maximum Transmission Unit - the largest packet size that can be transmitted on a link (typically 1500 bytes for Ethernet)

8
New cards

What is the purpose of the Identification field (16 bits)?

Unique number assigned by sending host to each datagram; all fragments of the same original datagram share this ID to allow reassembly at destination

9
New cards

What are the three flag bits in the IP header?

Bit 0: Reserved (always 0), Bit 1: DF (Don't Fragment) - 1 means don't fragment, Bit 2: MF (More Fragments) - 1 means more fragments follow

10
New cards

What is the Fragment Offset field used for?

Indicates the position of this fragment in the original datagram; measured in 8-byte blocks; allows receiver to reassemble fragments in correct order (range: 0 to 8191)

11
New cards

Example: Original datagram is 4000 bytes, MTU is 1500 bytes. How many fragments are created?

Three fragments: Fragment 1 (1500 bytes, offset 0), Fragment 2 (1500 bytes, offset 185), Fragment 3 (1060 bytes, offset 370, MF=0)

12
New cards

What is the purpose of the TTL (Time To Live) field?

Prevents packets from looping forever; initially set by source (typically 64 or 128), decremented by 1 at each router; when reaches 0, router discards packet and sends ICMP "Time Exceeded" message

13
New cards

What are typical initial TTL values?

Windows: 128, Linux/Mac: 64, Cisco routers: 255

14
New cards

What does the Protocol field (8 bits) identify?

Upper-layer protocol carried in payload: 1 = ICMP, 6 = TCP, 17 = UDP, 41 = IPv6, 89 = OSPF

15
New cards

What is the purpose of the Header Checksum field?

Error detection for header only (not payload); simple one's complement checksum; must be recalculated at each hop because TTL changes

16
New cards

Why does the IP header checksum only cover the header and not the payload?

Because payload is already protected by upper-layer protocols (TCP/UDP have their own checksums); this speeds up router processing

17
New cards

What is the typical overhead for TCP/IP?

IP header: 20 bytes, TCP header: 20 bytes, Total: 40 bytes (UDP header is only 8 bytes, so UDP+IP = 28 bytes)

18
New cards

What is an IP address?

A 32-bit identifier (in IPv4) that uniquely identifies an interface (not a device) on a network

19
New cards

Why are IP addresses assigned to interfaces, not devices?

Because routers typically have multiple interfaces (one per link) and hosts can have multiple interfaces (wired and wireless)

20
New cards

What is dotted-decimal notation?

Format for IP addresses: four decimal numbers (0-255) separated by dots, each representing 8 bits; Example: 192.168.1.100

21
New cards

How many total IPv4 addresses are possible?

2³² = 4,294,967,296 addresses (approximately 4.3 billion)

22
New cards

What are three special IP addresses?

0.0.0.0 (this network or unknown), 255.255.255.255 (broadcast to all hosts on local network), 127.0.0.1 (loopback - this computer)

23
New cards

What is a subnet?

A group of device interfaces that can physically reach each other without passing through an intervening router (same local network)

24
New cards

How do you identify subnets in a network?

Detach each interface from its host or router, create "islands" of isolated networks; each isolated network is a subnet

25
New cards

What are the two parts of an IP address structure?

(1) Subnet part (network prefix) - high-order bits, common to all devices in same subnet, (2) Host part - low-order bits, unique to each device within subnet

26
New cards

What is CIDR notation format?

a.b.c.d/x, where a.b.c.d is the IP address and /x is the number of bits in the subnet part (called "slash notation")

27
New cards

Example: 223.1.1.0/24. What are the subnet and host parts?

First 24 bits are subnet part (223.1.1), last 8 bits are host part; subnet mask is 255.255.255.0; number of usable hosts = 2⁸ - 2 = 254

28
New cards

Why subtract 2 when calculating usable host addresses?

Network address (all host bits 0) and broadcast address (all host bits 1) are reserved; Example: in 223.1.1.0/24, 223.1.1.0 is network address, 223.1.1.255 is broadcast

29
New cards

What were the three classes in classful addressing (before CIDR)?

Class A: first bit 0, /8 network (16M hosts), Class B: first bits 10, /16 network (65K hosts), Class C: first bits 110, /24 network (254 hosts)

30
New cards

What were the problems with classful addressing?

Wasteful (most organizations too big for Class C, too small for Class B), inflexible (couldn't create custom-sized networks), address exhaustion imminent

31
New cards

What is CIDR (Classless Inter-Domain Routing)?

Introduced in 1993, allows subnet portion to be arbitrary length (not just 8, 16, or 24 bits); format a.b.c.d/x where x can be any value 0-32

32
New cards

Example: 200.23.16.0/23. How many addresses?

23-bit subnet part leaves 9 bits for hosts; 2⁹ = 512 total addresses, 510 usable hosts

33
New cards

What are the three benefits of CIDR?

(1) Efficient address allocation - right-sized blocks, (2) Route aggregation - multiple networks in single routing entry, (3) Hierarchical allocation - matches network structure

34
New cards

What is route aggregation?

Multiple networks represented by a single routing entry; reduces routing table size dramatically and improves efficiency

35
New cards

Example: ISP has 200.23.16.0/20 and allocates eight /23 blocks. How many routing table entries needed with vs without aggregation?

Without aggregation: 8 entries (one per /23 block); With aggregation: 1 entry (the /20 block covers all eight /23 blocks)

36
New cards

What is the longest prefix matching rule?

When multiple forwarding table entries match a destination address, the router chooses the entry with the longest matching prefix (most specific route)

37
New cards

Example: Packet to 200.23.18.50 matches both 200.23.16.0/20 and 200.23.18.0/23. Which route is chosen?

200.23.18.0/23 because it has a longer prefix (23 bits vs 20 bits) - more specific route takes precedence

38
New cards

Why is longest prefix matching important?

Enables hierarchical routing, allows specific routes to override general routes, supports route aggregation while allowing exceptions

39
New cards

What is TCAM?

Ternary Content Addressable Memory - special hardware in routers for fast lookups; can search all entries in parallel in one clock cycle, independent of table size

40
New cards

What are the two methods for a host to obtain an IP address?

(1) Hard-coded (static) configuration - manually configured by administrator, (2) DHCP (Dynamic) - automatically obtained from DHCP server

41
New cards

When is static IP configuration used?

For servers (need stable addresses), routers and network equipment, printers and shared devices, critical infrastructure

42
New cards

What are the advantages of static IP configuration?

Predictable addresses, no dependency on DHCP server, works immediately on boot

43
New cards

What are the disadvantages of static IP configuration?

Manual effort for many devices, risk of address conflicts, must manually track assignments, must reconfigure if network changes

44
New cards

What is DHCP (Dynamic Host Configuration Protocol)?

Protocol that automatically assigns IP configuration to hosts joining a network; provides "plug-and-play" connectivity with no manual setup required

45
New cards

What configuration information can DHCP provide? (5 items)

(1) IP address, (2) Subnet mask, (3) Default gateway (first-hop router), (4) DNS server address(es), (5) Lease duration [Also: NTP server, domain name, WINS, boot server]

46
New cards

What are the four steps of the DHCP protocol?

(1) DHCP Discover - client broadcasts to find server, (2) DHCP Offer - server offers IP address, (3) DHCP Request - client accepts offer, (4) DHCP ACK - server confirms assignment

47
New cards

In DHCP Discover, what IP addresses does the client use?

Source IP: 0.0.0.0 (client has no IP yet), Destination IP: 255.255.255.255 (broadcast to entire subnet), Source Port: 68, Dest Port: 67

48
New cards

Why does DHCP Discover use source IP 0.0.0.0?

Because the client doesn't have an IP address yet; uses all zeros as a placeholder

49
New cards

Why does DHCP use broadcast (255.255.255.255) instead of unicast?

Client doesn't have an IP address yet and cannot receive unicast; broadcast reaches all devices including DHCP server

50
New cards

In DHCP Offer, what information does the server provide?

Offered IP address (yiaddr), lease time, server's own IP address, subnet mask, default gateway, DNS server, other configuration parameters

51
New cards

Why does the DHCP server broadcast its Offer response?

Client still doesn't have an IP address and can't receive unicast yet; client identifies the response by matching transaction ID

52
New cards

Can DHCP Discover and Offer steps be skipped?

Yes, if the client remembers and wishes to reuse a previously allocated address (RFC 2131), it can skip directly to DHCP Request

53
New cards

What information is included in the DHCP ACK message?

Confirms IP address assignment, includes subnet mask, default gateway, DNS server, lease time, and other configuration parameters

54
New cards

What is a typical DHCP lease duration?

Home networks: often 24 hours, Enterprise: may be weeks, Public Wi-Fi: often 1-2 hours

55
New cards

When does a DHCP client renew its lease?

Typically at 50% of lease time; if renewal fails, tries again at 87.5%; if still fails, must obtain new address

56
New cards

What happens when a DHCP lease expires?

Address returns to the pool and can be assigned to another client; enables efficient address usage for mobile devices

57
New cards

What are the DHCP port numbers?

Client uses port 68, Server uses port 67 (both UDP)

58
New cards

Describe the protocol stack encapsulation for DHCP Discover

DHCP message → UDP (ports 68→67) → IP (0.0.0.0 → 255.255.255.255) → Ethernet (broadcast MAC FF:FF:FF:FF:FF:FF) → Physical bits

59
New cards

How does a network obtain its subnet portion of IP addresses?

From their provider ISP, who subdivides their allocated address block and assigns portions to customers

60
New cards

Example: ISP has 200.23.16.0/20. How many /23 blocks can they create?

Eight /23 blocks (each with 512 addresses): 200.23.16.0/23, 200.23.18.0/23, 200.23.20.0/23, through 200.23.30.0/23

61
New cards

What is ICANN?

Internet Corporation for Assigned Names and Numbers - global authority for IP address allocation, DNS root zone management, and TLD delegation

62
New cards

What are the five Regional Internet Registries (RIRs)?

(1) ARIN - North America, (2) RIPE NCC - Europe/Middle East/Central Asia, (3) APNIC - Asia-Pacific, (4) LACNIC - Latin America/Caribbean, (5) AFRINIC - Africa

63
New cards

What is the IP address allocation flow hierarchy?

ICANN/IANA (global pool) → Regional RIRs → Large ISPs/National Registries → Smaller ISPs → Organizations → End Users

64
New cards

When did IPv4 addresses become exhausted?

2011 - ICANN allocated the last chunk of IPv4 addresses to RIRs; today IPv4 addresses are scarce and valuable ($20-50 per address)

65
New cards

What are the three solutions to IPv4 address exhaustion?

(1) NAT (Network Address Translation) - multiple devices share one public IP, (2) IPv6 - 128-bit addresses (3.4 × 10³⁸ addresses), (3) More efficient allocation - CIDR and reclaiming unused blocks

66
New cards

How many addresses does IPv6 provide?

2¹²⁸ ≈ 3.4 × 10³⁸ addresses (enough for every grain of sand on Earth to have an IP address)

67
New cards

What are the three RFC 1918 private address ranges?

(1) 10.0.0.0/8 (16.7M addresses - large orgs), (2) 172.16.0.0/12 (1M addresses - medium orgs), (3) 192.168.0.0/16 (65K addresses - home/small business)

68
New cards

What are the characteristics of private IP addresses?

Not routable on public Internet, can be used by anyone (no registration), must use NAT to communicate with Internet, locally unique only, reusable across different networks

69
New cards

Why can multiple networks use the same private IP addresses?

Because they're not routable on the public Internet and are separate networks; for example, every home network can use 192.168.1.0/24 without conflict

70
New cards

What is the IP header checksum algorithm?

Treat header as sequence of 16-bit words, sum all words, take one's complement of sum; receiver recalculates and discards packet if doesn't match

71
New cards

Why must the IP header checksum be recalculated at each router?

Because the TTL field changes at each hop (decremented by 1), so the checksum must be recomputed

72
New cards

What mechanism does traceroute use to discover the path?

Uses the TTL field: sends packets with incrementing TTL values (1, 2, 3…); each router decrements TTL and returns "time exceeded" when TTL reaches 0

73
New cards

Calculate: Packet of 100 bytes application data with TCP/IP headers. What is the efficiency?

Application data: 100 bytes, Headers: 40 bytes (20 IP + 20 TCP), Total: 140 bytes, Efficiency: 100/140 = 71%

74
New cards

Calculate: For 223.1.1.0/24, what are the network address, broadcast address, and usable range?

Network: 223.1.1.0, Broadcast: 223.1.1.255, Usable range: 223.1.1.1 through 223.1.1.254 (254 usable addresses)

75
New cards

What does Path MTU Discovery use?

The DF (Don't Fragment) flag; if packet too large for link, router drops it and sends ICMP error; sender reduces packet size until it fits entire path

76
New cards

Why is IPv6 deployment slow despite IPv4 exhaustion?

Requires infrastructure upgrades, backward compatibility challenges, NAT provides temporary solution, transition costs are highv