28. IP Addressing Overview and Demonstration
What is an [[IP address]] ?
- Layer 3 logical address assigned by an administrator.
- Used to identify other devices on the network
- Every device has a unique IP Address. 2 devices can’t have the same IP address, thus why we are slowly moving towards IPv6.
29. IP Characteristics and IPv4 Address Format
Each website resolves to another IP Address.
Websites on the internet resolve to IPv4 addresses.
IPv4
- it is Layer 3 -> Network Layer Protocol #CCNA/DavidBombal/OSImodel/Layer3
- It is connectionless (no session is formed)
- [[TCP]] on the other hand is connection oriented (but it is a higher level protocol) #CCNA/DavidBombal/OSImodel/Layer4
- Before any data is transmitted, devices using TCP goes through something called a [[3 way handshake]]. TCP is able to handle dropped packets, corrupted or misdirected packets.
graph LR A[Transmitter] --1.SYN--> B[Receiver] --2.SYN ACK -->A --3.ACK-->B
- In IP or IPv4 - packets are treated independently. Thus they can travel independently and take different paths to get to their destination. Thus routers will route IP traffic, using Load balancing, bandwith (OSPF), hopcount (RIP) etc. In other words, each routing protocol will use their own metrics to determine the best path. Which is based on [[hierarchical addressing structure]] in IPv4 and IPv6, where we have both network and host portion as part of an address. Routers route their traffic based on Network portion of the address
- IP does best effort delivery (it is not 100%, thus packets could be miss-directed, lost or duplicated)
- IP has no data recovery features
- IP has no session
- IP is unable to do a retransmission of packets
IP Address
- It is 32bit in size.
- 4 octets
- Each octet 8bit in size
- Usually written in dotted decimal notation. e.g. 10.1.1.1
- Uses [[hierarchical addressing structure]] to enable routing
- If [[unicast]] (to single recipient) packets are transmitted, then routing is done based on network portion of an address
- If [[multicast]] (to multiple recipients) packets are transmitted, then routing is done based on host portion of an address
30. Network versus Host portion
[[IP address]] consists of 2 portions:
- Network portion or Network ID
- Host Portion or Host ID
Network portion/ network ID - identifies specific network. And routers have routing tables based on network addresses.
Host ID helps to identify the endpoint on a network .e.g.: printer, computer, server, iPhone etc.
31. IPv4 Address format (Street Analogy) and Address Classes
Address Classes were used until introduction of Classless in Domain routing ([[CIDR]]) in 1993
Class A \
Class B - Unicast
Class C /
Class D - multicast
Class E - reserved for future experiments
IPv6 doesn’t use classes, and in IPv4 address classes were replaced with CIDR
32. Class A and B addresses
Class A
Starts with a binary 0 e.g.: 00000000 to 01111111 or 0 to 127
- 0.0.0.0 to 127.255.255.255
- 127 is reserved for a loopback e.g.: 127.0.0.1
- 0 is reserved for the default network 0.1.1.1
- Actual usable range is 1.0.0.0 to 126.255.255.255
- 00000000.00000000.00000000.00000000
- 1st octet is a network ID
Class B
Starts with 10 (one and zero) 10000000(128) to 10111111(191)
- 128.0.0.0 to 191.255.255.255
- 00000000.00000000.00000000.00000000
- 1st 2 octets are network portions
- 1st 2 octets are network portions
33. Class C, D, E, A and B addresses
Class C
Starts with 110 -> 11000000(192) to 11011111(223)
- 192.0.0.0 to 223.255.255.255
- 00000000.00000000.00000000.00000000
- 1st 3 octets are network portions
Class D
Used for [[multicast]]
Starts with 11100000(224) to 11101111(239)
- 224.0.0.0 to 239.255.255.255
- e.g. [[OSPF]] uses 224.0.0.5, 224.0.0.6 and these multicasts in 224 range are known as [[Link Local Multicast]]s, as they don’t propage the local segment
- OSPF and RIP are examples
Class E
Start with binary 1111
- 240.0.0.0 to 255.255.255.255
- 255.255.255.255 is reserved address for broadcast
34. Special IPv4 Addresses and Directed Broadcast Address
[[Directed Broadcast Address]] - host sends data to all devices on a specific network.
255.255.255.255 or e.g. 172.31.255.255 to broadcast to all devices on 172.31 network.
- Routers can route directed broadcast but are disabled by default
35. Local Broadcast Address
[[Local Broadcast Address]] is used to communicate with all devices on the local network
- Address is populated with binary 1s e.g. 255.255.255.255
- It is used to request an IP address from a DHCP server
- Dropped by Layer 3 routers and switches, although can be configured with DHCP forwarding or relay
36. Local Loopback Address
[[Local Loopback Address]] - used to let a system send a message to itself for testing e.g. to test TCP/IP stack on the machine
- 127.0.0.1
- in IPv6 loopback is
::1^1656947828906 - Not the same with Router loopback address
37. RFC1918 - Private Addresses
RFC - request for comments
RFC1918 - Private IP Addresses and are non-routable
10.0.0.0
172.16.0.0
192.168.0.0
38. RFC1918 - Class A, B, C and IPv4 Link Local Addresses
1 Class A network - 10.0.0.0
16 Class B network - 172.16.0.0
256 Class C Networks - 192.168.0.0
Thus if IP does fall under this range, then it needs to be NAT(Network Address Translation)’ed e.g. converted to another IP
[[IPv4 Link-Local Addresses]] - [[APIPA]] (Automatic Private IP Address). When e.g. PC is configured for DHCP, but it fails to allocate them their IP address. Thus computers are then able to use Link Local IP addresses to communicate on a local network even when no DHCP is available.
- 169.254.0.0/16
- Traffic in this address range is not routable
39. Subnet Masks
Subnet Masks help determine which portion of an IP address is Network ID and which part is Host ID.
- It helps to determine if a device is remote or local?
- Remote (needs default gateway - different subnet)
- Local (doesnt need default gateway - same subnet)
Class A,B, C masks are called natural masks
Class A: 255.0.0.0
Class B: 255.255.0.0
Class C: 255.255.255.0
e.g. 10.1.1.1 255.0.0.0 is on network 10
10.1.1.1 255.255.0.0 is on network 10.1
40. Subnet mask demonstrations and Discontiguous Network Masks
Discontiguos Network Masks are not supported by CISCO devices (e.g. when in binary 1 and 0 are mixed back and forth)
e.g. 240.255.3.191
Only contiguous subnet masks are supported (e.g. all 1s in binary):
e.g. 255.255.192.0
41. CIDR Notation Part 1 and Part 2
Introduced in 1993 and replaced Classful IP Addressing.
- uses Variable Length Subnet Mask ([[VLSM]])
- uses 10.0.0.0/8 instead of 10.0.0.0 255.0.0.0 notation
255.255.255.0 = /24
11111111.11111111.11111111.00000000 = 24 of 1s
42. CIDR Notation Part 3
Class A - 16milion addresses - /8
Class B - 65k addresses - /16
Class C - 254 addresses - /24
What if company needs only 3000 addresses? Class A & B is way too big, C is too small.
In CIDR we can move the mask.
255.224.0.0 = 11111111.11100000.00000000.00000000 = /11
11 binary 1s or /11
Flashcards/Active Recall Q+A
What is an [[IP address]]? #card
- Layer 3 logical address. 32bit, 4 octet. Dotted decimal notation (e.g. 10.1.1.1)
- Helps to identify other devices on the network
- Each device must have a unique IP address
What is [[IPv4]]? #card
- It is jsut a simple IP address or Traditional IP address which is also known as IPv4. It defines both network and host addresses.
- Connectionless (no session is formed)
- Packets are treated independently and can take different paths.
- There are multiple routing protocols and each of them will use different metrics for determining the best path. E.g. routers route traffic based on Load Balancing, bandwidth(OSPF), hopcount (RIP).
- Uses [[hierarchical addressing structure]] (like phonebook with countrycode, areacode etc. etc.):
- IP is divided into hierarchical groups which are then much easier to manage and helps prevent IP depletion.
- Network portion, host portion, submask
- Best effort delivery, without any error checking, data recovery or retransmission.
What layer is IPv4? #card
- Layer 3 - Network Layer
Do routers route based on network ID or Host ID? #card
- Network ID. Because they deal with unicast packets. Data goes and comes from the outside, from the remote
What is the difference between TCP/IP and IPv4? #card
- TCP/IP are 2 different things. IP looks up IP address, TCP does data delivery.
- [[IP]] (Internet Protocol or IPv4) is connectionless Network Layer 3 logical protocol. It only obtains the address to which packets can be sent.
- [[TCP]] is Transmission Control Protocol which resides at Transport - Layer 4 of OSI Model. And is connection oriented. It needs to form a session and go through something called a [[3 way handshake]]. SYN -> SYN ACK -> ACK. When session is established packets can be checked if they were corrupted, misdirected, dropped etc. and can be easily retransmitted if needed.
Difference between [[unicast]] and [[multicast]] ? #card
- If [[unicast]] (to single recipient) packets are transmitted, then routing is done based on network portion of an address. Class A, b C
- If [[multicast]] (to multiple recipients) packets are transmitted, then routing is done based on host portion of an address. Class D
What is the difference between network portion and host portion? #card
- Network portion or network ID identifies specific network, like a bigger area.
- Host portion identifies an endpoint on the network e.g.: pc, iPhone, printer etc.
What is classful IP address? #card
- There used to be Class A, B, C, D, E classes until 1993 after which they were replaced with CIDR.
What is Class A address and what are its range? #card
- Starts with binary 0 (00000000 to 01111111)
- 0.0.0.0 to 127.255.255.255
- Range from 1 to 126
- 127 is reserved for loopback
- 00000000.00000000.00000000.00000000
- 1st octet is a network ID
What is Class B address and what are its range? #card
- Starts with 10 (one and zero) 10000000(128) to 10111111(191)
- 128.0.0.0 to 191.255.255.255
- 00000000.00000000.00000000.00000000
- 1st 2 octets are network portions
What is Class C address and what are its range? #card
- Starts with 110 -> 11000000(192) to 11011111(223)
- 192.0.0.0 to 223.255.255.255
- 00000000.00000000.00000000.00000000
- 1st 3 octets are network portions
What is Class D & E address and what are its ranges? #card
-
Class D
- Used for [[multicast]]
- Starts with (224) to 11101111(239)
- 224.0.0.0 to 239.255.255.255
- e.g. [[OSPF]] uses 224.0.0.5, 224.0.0.6 and these multicasts in 224 range are known as [[Link Local Multicast]]s, as they don't propage the local segment
- OSPF and RIP are examples
-
Class E
- Start with binary
- 240.0.0.0 to 255.255.255.255
- 255.255.255.255 is reserved address for broadcast
What is [[Directed Broadcast Address]]? #card
- e.g. 172.31.255.255 to broadcast to all devices on 172.31 network
What is [[Local Broadcast Address]]? #card
- It is used to communicate with all devices on the local network
- Address is populated with binary 1s e.g. 255.255.255.255
- It is used to request an IP address from a DHCP server
- Dropped by Layer 3 routers and switches, although can be configured with DHCP forwarding or relay
What is [[Local Loopback Address]] ? #card
- [[Local Loopback Address]] - used to let a system send a message to itself for testing e.g. to test TCP/IP stack on the machine
- 127.0.0.1
- in IPv6 loopback is `::1`
- Not the same with Router loopback address
What is RFC1918? #card
- It defines Private IP address ranges. Which are not available to general public. Thus any Ip addresses assigned to that range need to be NATed.
- 1 Class A network - 10.0.0.0
- 16 Class B network - 172.16.0.0
- 256 Class C Networks - 192.168.0.0
What is [[APIPA]]? #card
- APIPA stands for Automatic Private IP Address. Works as an alternative when DHCP fails.
- APIPA range is at 169.254.0.0/16 - > and traffic in this range is not routable
What is APIPA range? #card
- `169.254.0.0/16`
What is a subnet mask? #card
- Subnet masks help divide the network.
- Subnet masks help determine which portion of an IP address is Network ID and which part is Host ID.
- It helps to determine if a device is remote or local?
- Remote (needs default gateway - different subnet)
- Local (doesnt need default gateway - same subnet)
- Class A,B, C masks are called natural masks.
- Class A: 255.0.0.0
- Class B: 255.255.0.0
- Class C: 255.255.255.0 e.g. 10.1.1.1 255.0.0.0 is on network 10 10.1.1.1 255.255.0.0 is on network 10.1
What are natural subnet masks? #card
- Masks which were used prior to CIDR notation, and had to specify the masks explicitly with e.g. 255.255.255.0
What are discontiguous network masks? #card
- Masks where binary 1s and 0s don't go in the same order.
- Mask must be 11111111.00000000.00000000.00000000
- But no 10101100.00000000.00000000.00000000 - these are discontiguos masks, and they are not allowed on CISCO devices.
What are contiguous network masks? #card
- Contiguos network masks are those which have all binary 1s in the beginning, without any 0 in-between.
- E.g. 11111111.00000000.00000000.00000000
What is CIDR notation? And why it is better than classful addressing? #card
- uses 10.0.0.0/8 instead of 10.0.0.0 255.0.0.0 notation
- 255.255.255.0 = /24 -> 11111111.11111111.11111111.00000000 = 24 of 1s
- 255.224.0.0 = 11111111.11100000.00000000.00000000 = /11
- 11 binary 1s or /11
What is [[VLSM]]? #card
- VLSM stand for Variable Length Subnet Masks - e.g. mask when converted into binary 11s and 0s can be allocated and moved around to a specified and or desired number, thus saving precious IP addressing space.
One Page Summary
IPv4, TCP, Classful IP Addressing, VLSM, CIDR, subnetting, subnet masks, APIPA, DHCP