IPv4 addressing (1)

Network layer

OSI Model & TCP-IP Suite#3 Network layer

Routing

  • IP addresses are logical addresses you assign when you configure the device.

  • Switches do not separate differenet networks. They connect and expand networks.

  • Even if you have multiple PCs and Switches connected, they'd still belong to one network/LAN.

  • Because of this, all PCs have IP addresses in the same Layer3 network 192.168.1.0/24 (PC1 - 192.168.1.1, PC2 - 192.168.1.2).

  • If you put a Router in between 2 switches, the network is split into 2 networks (192.168.1.0/24, 192.168.2.0/24).

  • Router needs IP address for each network it is connected to.

  • Now if PC1 sends a broadcast frame, the switch receives it and forwards it out to all interfaces (except the one it received from).

  • Switch sends the frame out of G0/1 and G0/2, and PC1 and Router receive the frame. It ends there.

  • Broadcast is limited to the local network.

IPv4

Intro

  • Internet Protocol (IP) is the primary Layer3 protocol in use today and v4 (version 4) is the one used in most networks.

  • IP addresses are 32 bits (4 bytes) in length.

Decimal, Hex, Binary

  • Decimal (base 10) : 3294 (3* 1000 + 2* 100 + 9* 10 + 4* 1 = 3294)

  • Hexadecimal (base 16) : CDE (12* 256 + 13* 16 + 14* 1 = 3294)

  • Binary (base 2) : 192.168.1.254 = 11000000.10101000.00000001.11111110

  • These 8 bit groups are called octets.

  • Range of possible numbers that can be represented with 8 bits ranges from 0 to 255.

(Learn to convert Binary to Decimal and vice versa)

IPv4 address

  • IP addresses have 4 octets.

  • /24 at the end tells us first 3 octets (24 bits) represent the network and the last octet (8 bits) represents the end hosts (PCs).

IPv4 class

ClassFirst octetNumeric rangePrefixNetmaskNetworksAddresses

A

0xxxxxxx

0 - 127

/8

255.0.0.0

2^7 (128)

2^24 -2 (16m)

B

10xxxxxx

128 - 191

/16

255.255.0.0

2^14 (16k)

2^16 -2 (65k)

C

110xxxxx

192 - 223

/24

255.255.255.0

2^21 (2m)

2^8 -2 (255)

  • Class A : **12.**128.251.23/8 (fewer network addresses, many hosts)

  • Class B : **154.78.**111.32/16

  • Class C : **192.168.1.**254/24 (many possible networks, fewer hosts)

ClassFirst octetNumeric rangeUses

D

1110xxxx

224 - 239

Multicast purposes

E

1111xxxx

240 - 255

Experimental purposes

  • Class D - Multicast purposes.

  • Class E - experimental uses.

Loopback addresses

  • End of Class A is usually considered to be 126, not 127.

  • 127 range - reserved for loopback purposes.

  • Range : 127.0.0.0 to 127.255.255.255

  • Used to test the 'network stack' of the local device.

  • If a device sends any network traffic to an address in this range, it is simply processed backup the TCP/IP stack as if it were traffic received from another device.

  • ping 127.0.0.1 or any address in the 127 range and your PC will respond to its own pings.

  • The round trip times will be 0ms because the traffic isn't going anywhere

Network address

  • First address in each network.

  • Cannot be assigned to a host.

  • Host portion on an IP address is all 0's.

  • Eg: 192.168.1.0/24

  • First usable address is the one above the network address (192.168.1.1)

Broadcast address

  • Layer3 address used to send a packet to all hosts on the local network.

  • Last address in a network.

  • Also, cannot be assigned to a host.

  • Host portion is all 1's.

  • Eg: 192.168.1.255/24

  • The last usable address is the one under the broadcast address (192.168.1.254)

  • If a packet is send with a broadcast IP address (192.168.1.255) as the destination IP address, the destination MAC address would be broadcast MAC address - all F's (FF.FF.FF.FF.FF.FF). If PC1 from above picture sent a ping to 192.168.1.255, it would be received by PC2 and R1's G0/0 interface.

Last updated