Layer 3 and IP
- IPv4 is the main protocol at Layer 3 (Network layer)
- Every router interface needs an IP address from its connected network
- IP header contains:
- Source IP (4 bytes)
- Destination IP (4 bytes)
- Plus other fields (e.g., TTL, Protocol, Checksum)
IP Broadcast
- Example:
192.168.1.255/24
is a broadcast address - When a computer sends a packet to this IP, it:
- Encapsulates it into an Ethernet frame
- Uses destination MAC address:
FFFF.FFFF.FFFF
(broadcast)
Binary Conversion
Binary to Decimal
- Binary
11000000
=192
- Bit positions:
128 64 32 16 8 4 2 1
→ sum active bits
Decimal to Binary
- Example: Convert 255 → write decreasing powers of 2
- Helpful decimal values to remember:
128
,192
,224
,240
— help quickly identify subnet masks- Binary
1111
= decimal15
Number Systems
Base | Description |
---|---|
Binary | Base-2 → powers of 2 |
Decimal | Base-10 → powers of 10 |
Hexadecimal | Base-16 → powers of 16 |
IPv4 Address Classes
Class | Binary Start | Range | Notes |
---|---|---|---|
A | 0xxxxxxx | 1–126 | 0.0.0.0 reserved, 127.x.x.x is loopback |
B | 10xxxxxx | 128–191 | – |
C | 110xxxxx | 192–223 | – |
D | 1110xxxx | 224–239 | Multicast addresses |
E | 1111xxxx | 240–255 | Experimental |
- Class is determined by the first octet
- Multicast ≠ unicast or broadcast
127.0.0.0/8
= loopback range → used to test TCP/IP stack
Network vs Broadcast Addresses
Type | Host Bits | Example | Assignable? |
---|---|---|---|
Network Address | All 0 s | 192.168.1.0 | ❌ |
Broadcast Address | All 1 s | 192.168.1.255 | ❌ |
Subnet Breakdown (Example: 192.168.1.0/24
)
Address | Meaning |
---|---|
192.168.1.0 | Network Address |
192.168.1.1 | First usable host |
192.168.1.254 | Last usable host |
192.168.1.255 | Broadcast Address |
- Host bits: 8 →
2^8 = 256
total addresses - Usable:
256 - 2 = 254
hosts
Cisco Router IP Configuration
Show interface summary
R1# show ip interface brief // or: sh ip int br
Field | Description |
---|---|
OK | Legacy (no longer relevant) |
Method | How IP was assigned (manual/unset) |
Status | Layer 1 state (shutdown?) |
Protocol | Layer 2 state (cable plugged in?) |
Configure IP Address on Interface
R1# conf t
R1(config)# interface gigabitethernet 0/0 // shortcut: in g0/0
R1(config-if)# ip address 10.255.255.255 255.0.0.0
R1(config-if)# no shutdown
R1(config-if)# do show ip int br // to verify
- To switch interface from config-if mode: repeat
interface g0/x
command
Interface Commands
R1# show interfaces g0/0 // detailed info
R1# show interfaces description // summary
R1(config-if)# description ## to SW1 ##
R1(config-if)# do show interfaces description
📌 These are personal study notes. Please read the full disclaimer for more information.
Category: CCNA