You are on page 1of 40

IBU CEN 263: Computer

International Burch University


Networks
Lecture 2

Dr. Elma Avdic


CEN 263: Computer
Networks
Lecture 2
Today’s Class
● Recaps ● Routing
● The Network Layer ○ Introduction
○ Introduction ○ Routing Tables
○ IP Addresses
○ IP Datagrams and
Encapsulation
○ IP Address Classes
○ ARP
○ Looking up IP addresses
● Subnetting
○ Subnet Masks
○ Binary Math
○ CIDR
Recaps
● How TCP/IP model works?
● Basic networking devices
● Label each of the five layers in TCP/IP model
● How the PHY layer works?
● How the Data Link layer works?
The Data Link Layer: Ethernet Frame
Data packet
An all-encompassing term that represents any single set of binary data being sent across a network link.
Ethernet frame
A highly structured collection of information presented in a specific order.
Preamble
8 bytes (or 64 bits) long, and can itself be split into two sections.
Destination MAC address
The hardware address of the intended recipient.
Preamble SFD Source address Ether-type FCS
8 bytes 1 byte 6 bytes 2 bytes 4 bytes

Destination address VLAN header Payload


6 bytes 4 bytes 0 - 1,500 bytes
The Data Link Layer: Ethernet Frame (2) - VLAN
Virtual LAN (VLAN) Switch
A technique that lets you have multiple logical LANs
operating on the same physical equipment.
VLAN header
It indicates that the frame itself is a VLAN frame.
If a VLAN header is present, the EtherType field follows it.
VLAN 2 VLAN 1
Payload
In networking terms, is the actual data being transported,
which is everything that isn’t a header.
Frame Check Sequence
A 4-byte (or 32-bit) number that represents a checksum value
(calculated by doing a CRC against the frame) for the entire frame. VLAN 1
VLAN 2

Preamble SFD Source address Ether-type FCS


8 bytes 1 byte 6 bytes 2 bytes 4 bytes

Destination address VLAN header Payload


6 bytes
The Data Link Layer: Ethernet Frame (3)

4773099563521
CRC
Checksum
number
DATA
IP header /
TCP header

Checksum Checksum Checksum


number Ethernet number RNI number

Calculating IP Calculating IP
header TCP header TCP
header header

Checksum Checksum
number number
correct correct
Frame formats
Point to Point Multipoint / Broadcast

Ethernet

Switch
Ethernet Frame

6 bytes 6 bytes 2 bytes 46-1500 bytes 4 bytes


7+1 bytes
ff:ff:ff:ff:ff:ff:ff:ff

64 - 1500 bytes

Ethernet Switch MAC


addresses

68:e8:56:37:de:2e 80:f8:47:36:51:1a 68:56:35:8e:2c:2

1 2 3
Additional Slides
How your network works: basic diagram of a network
Discussion points:
1. Physical vs.
Logical way
Websites 2. Speed
VPN
connections
Email
Internet ...
● NETWORK DEVICES
○ MODEM
○ ROUTER
○ HUB
○ SWITCH and
Switch Firewall Router Modem Internet Cloud PATCH PANELS
or The Cloud or ○ WiFi AP and 802.11
Splitter of the Does 1st Cloud ● NETWORK CABLING
Internet networking device to Computing = ● CLIENTS and SERVERS
signal; all well: 1. allows connect Internet
devices computers to you to
connected to talk to each Internet
switch other, and 2.
Logically this is how
get on the your network works:
Internet all these logical
devices are now in
one physical device.
Discussion points: Speed, Devices, Cabling,
Client-Server Architecture
● NETWORK DEVICES
Data is sized by two measurements: ○ MODEM
○ ROUTER
Bit → b → Kb 8b = 1B ○ HUB
○ SWITCH and PATCH
Byte → B → KB
PANELS
DL 16 Mb → 2MB (ISPs) ○ WiFi AP and 802.11
● NETWORK CABLING
UL 100 MB → 8x longer, 8b=1B
● CLIENTS and SERVERS
IPv4 Addressing: Binary and the IP Address
11100010 10101000 10101010 01100011 BINARY

Magic chart

128 64 32 16 8 4 2 1
0_ 0_ 0_ 0_ 0_ 0_ 0_ 1_ =1

27 26 25 24 23 22 21 20

0 1 1 1 1 1 1 1 = 127
_ _ _ _ _ _ _ _
IPv4 Addressing: Binary and the IP Address
192.168.1.5 IP address in BINARY

11000000 10101000 00000001 00000101


Magic chart

128 64 32 16 8 4 2 1

27 26 25 24 23 22 21 20
Trailer: Subnetting
Network and Host ID
Subnet Mask
192.168.40.55 - What is the Network ID
192.168.40.55 IP address classes

11111111.11111111.00101000.00000000 Network ID = 192.168.40.0/21


11111111.11111111.11111000.00000000 255.255.248.0
255.255.248.0

/24 CIDR notation

Magic chart

128 64 32 16 8 4 2 1

27 26 25 24 23 22 21 20
IPv4 Addressing: The Classes
Subnetting on a Class C example:

192.168.1.0
255.255.255.0

Magic chart

128 64 32 16 8 4 2 1

27 26 25 24 23 22 21 20
IP addressing: introduction
223.1.1.1
❖ IP address: 32-bit 223.1.2.1

223.1.1.2
223.1.1.4 223.1.2.9

❖ Interface
223.1.3.27
223.1.1.3
223.1.2.2

❖ IP address per
interface 223.1.3.1 223.1.3.2

223.1.1.1 = 11011111 00000001 00000001 00000001


223 1 1 1

Network Layer 4-17


IP addressing: introduction
223.1.1.1
Q: how are interfaces 223.1.2.1
actually connected? 223.1.1.2
223.1.1.4 223.1.2.9
A: we’ll learn about
that in chapter 5, 6. 223.1.1.3
223.1.3.27
223.1.2.2

A: wired Ethernet interfaces


connected by Ethernet switches 223.1.3.1 223.1.3.2

For now: don’t need to worry


about how one interface is
connected to another (with no A: wireless WiFi interfaces
intervening router) connected by WiFi base station
Network Layer 4-18
Subnets
❖ IP address: 223.1.1.1
▪subnet part - high 223.1.1.2 223.1.2.1
order bits 223.1.1.4 223.1.2.9
▪host part - low order 223.1.2.2
223.1.1.3 223.1.3.27
bits
subnet
❖ what’s a subnet ?
▪device interfaces with 223.1.3.1 223.1.3.2

same subnet part of


IP address network consisting of 3 subnets
▪can physically reach
each other without
Network Layer 4-19
Subnets
223.1.1.0/24
223.1.2.0/24
223.1.1.1
recipe
❖ to determine the 223.1.1.2
223.1.1.4 223.1.2.9
223.1.2.1

subnets, detach 223.1.2.2


each interface from 223.1.1.3 223.1.3.27

its host or router, subnet

creating islands of 223.1.3.1 223.1.3.2


isolated networks
❖ each isolated 223.1.3.0/24
network is called a subnet mask: /24
subnet Network Layer 4-20
Subnets 223.1.1.2

how many? 223.1.1.1 223.1.1.4

223.1.1.3

223.1.9.2 223.1.7.0

223.1.9.1 223.1.7.1
223.1.8.1 223.1.8.0
223.1.2.6 223.1.3.27
223.1.2.1 223.1.2.2 223.1.3.1 223.1.3.2

Network Layer 4-21


Subnets 223.1.1.2

how many? 223.1.1.1 223.1.1.4

223.1.1.3

223.1.9.2 223.1.7.0

223.1.9.1 223.1.7.1
223.1.8.1 223.1.8.0
223.1.2.6 223.1.3.27
223.1.2.1 223.1.2.2 223.1.3.1 223.1.3.2

Network Layer 4-22


IP addressing: Classful
Class C: /24
Class B: /16
Class A: /8

subnet host
part part
11001000 00010111 00010000 00000000
200.23.16.0/24

Network Layer 4-23


IP addressing: CIDR
CIDR: Classless InterDomain Routing
▪ subnet portion of address of arbitrary length
▪ address format: a.b.c.d/x, where x is # bits in
subnet portion of address
subnet host
part part
11001000 00010111 00010000 00000000
200.23.16.0/23

Network Layer 4-24


● IP addressing
● Subnetting
The Network ● Binary math
● Encapsulation
Layer ● ARP
● Internet
● Routing intro
The Network Layer: IP addressing (1)
Small scale communication (MAC addressing) - nodes can communicate with each other through their physical MAC
address.
Large scale communication → IP and IP addresses

# Layer Protocol Protocol Addressing Device


Data Unit

5 Application HTTP, SMTP, Messages -


etc...

4 Transport TCP/UDP Segment Port #’s

3 Network IP Datagram IP address Router

2 Data Link Ethernet, Frames MAC Address Switch


Wi-Fi

1 Physical 10 Base T, Bits - Hub


802.11
Net Layer: IP addressing (2) - IP Addresses
32-bit long numbers = 4 octets (each described in decimal numbers 0-255)
12.34.56.78
00001100.00100010.00111000.01001110
123.456.789.100
01111011.1110001000.1100010101.01100100
8 7 6 5 4 3 2 1.9 8 7 6 5 4 3 2 1.10 9 8 7 6 5 4 3 2 1.8 7 6 5 4 3 2 1

dotted decimal notation

IP addresses belong to networks, not to the devices attached to those networks.

Static (configured on a node manually) vs. dynamic IP addresses (assigned through a DHCP)

In most cases, static IP addresses are reserved for servers and network devices, while dynamic IP
addresses are reserved for clients.
Net Layer: IP addressing (2) - Datagrams and Encapsulation

IP Datagram Header
Data Data Data Data
0 4 8 16 19 31
Header
Version
Length Service Type Total Length Data Data Data Data
Identification Flags Fragment Offset
TTL Protocol Header Checksum
Source IP Address
Destination IP Address
Options Padding 1 Data 2 Data 3 Data 4 Data

IP datagram = a packet at the Network Layer


...a highly structured series of fields that are strictly defined;
1 Data
Two primary sections of an IP datagram =
header + payload
4 Data

Workstation 01 Workstation 02
Net Layer: IP addressing (3) - Datagrams and Encapsulation
Data Data Data Data
TTL field
… an 8-bit field that indicates how many router hops a datagram can Data Data Data Data
traverse before it’s thrown away.

3 Data
3 TTL
1 TTL

D
4 TTL
2 TTL 3 Data 1 Data 2 Data 4 Data
0 TTL
C
E
Workstation 01

A B F I

5 TTL 4 TTL 3 TTL 2 TTL 2 TTL

Server
Workstation 01
Net Layer: IP addressing (4) - Datagrams and Encapsulation

Message
Application

TCP or
UDP Message
header Transport

TCP or
IP header UDP Message
header Network

TCP or
Ethernet Ethernet
header
IP header UDP Message footer
header Data Link
Example: Understanding Packets & Frames
Data

Packet I want to Data


send this
decapsulation
Frame data to Packet
10.10.10.2
encapsulation Frame
Frame Frame Frame

G0/0 R1 G0/1
Network Network
192.168.100.0 Default Gateway 10.10.10.0
IP 192.168.100.2 IP 10.10.10.2
MAC AA-AA-AA-AA-AA-AA G0/0: 192.168.100.1 MAC BB-BB-BB-BB-BB-BB
CC-CC-CC-CC-CC-CC

G0/1: 10.10.10.1
DD-DD-DD-DD-DD-DD
Net Layer: IP addressing (5) - IP Address Classes

IP addresses can be split into two sections: the network ID and the host ID.
[9.100.100.100
network ID
host ID
Address class system: A way of defining how the global IP address space is split
up.
Class A: 123.456.780.00
network ID host ID
Class B: 123.456.780.00
network ID host ID
Class C: 123.456.780.00
network ID host ID
Net Layer: IP addressing (6) - IP Address Classes

Class Left-most bit Starting IP address Last IP address

A 0xxx 0.0.0.0 127.255.255.255 2^24 = 16,777,216 addresses

B 10xx 128.0.0.0 191.255.255.255 how many?

C 110x 192.0.0.0 223.255.255.255 2^8 = 256 addresses

D 1110 224.0.0.0 239.255.255.255 how many?

E 1111 240.0.0.0 255.255.255.255 how many?

Octet = 8 bits; each octet can take value 0-255


Net Layer: IP addressing (7) - Address Resolution Protocol
ARP table entries generally expire after a short
amount of time to ensure changes in the network
are accounted for.

{FF;FF;FF;FF;FF;FF} {FF;FF;FF;FF;FF;FF}

Switch Switch
Who is 10.20.30.40?
I need your MAC address. {FF;FF;FF;FF;FF;FF} I am 10.20.30.40?

HOST A HOST A ARP Response ARP


Response
00-14-22-01-23-45

I will send you my MAC


10.20.30.40
address
00-14-22-01-23-45
Example: What is ARP?
ARP Packet Format
Hey, what’s your MAC?
Ethernet IP header

Destination Source Type


0x8060
ARP Request or ARP Reply Padding CRC
address address
6 6 2 26 10 4

Address Resolution Protocol defined by IETF RFC


826: https://tools.ietf.org/html/rfc826
- Used to resolve IP adds into MAC adds Hardware type (2 bytes) Protocol type (2 bytes)
- Win/Mac/Linux command: “arp -a” Hardware address Protocol address
- Cisco IOS (router or switch): “show arp” Operation code (2 bytes)
length (1 byte) length (1 byte)
- The ARP cache includes static and
dynamically learned entries Source hardware address
- Before sending network communication
computers reference the aRP cache Source protocol address
- If no MAC add is present then an ARP
Request is sent to determine the MAC Destination hardware address
address
- After the ARP is completed, the ARP cache Destination protocol address
is updated
Example: What is ARP?
Gratuitous ARP RARP
Reverse Address Resolution Protocol defined by
IETF RFC 903: https://tools.ietf.org/html/rfc903
Hey, here is my MAC - Was used to resolve MAC addresses into
and my IP! IP addresses and required servers on
every network.
- RARP has been deprecated and it’s
processes have been replaced by BOOTP
and Dynamic Host Configuration Protocol
(DHCP) (hands out IP adds) which provide
better and more services than RARP
- DHCP is used primarily to automatically
assign IP addresses to hosts on a network.
● An ARP announcement to update other -
hosts ARP tables without the need for an
ARP Request
● Sometimes performed during the computer
operating system startup process
● Helps to update the network faster when
there was a recent change to a hosts IP
address
Example: What is ARP?
Frame
ARP Diagram
ARP Request to FF-FF-FF-FF-FF-FF
I wan That’s me,
From AA-AA-AA-AA-AA-AA sen t to replying to
d th
Who is 10.10.10.55? data t is ARP
o request
10.10 ARP Request to
.10.55 FF-FF-FF-FF-FF-FF
From AA-AA-AA-AA-AA-AA
Who is 10.10.10.55?
ARP Request to
FF-FF-FF-FF-FF-FF
From AA-AA-AA-AA-AA-AA
Who is 10.10.10.55?

10.10.10.105 10.10.10.55
AA-AA-AA-AA-AA-AA BB-BB-BB-BB-BB-BB
But I need
to know the ARP Request to
MAC FF-FF-FF-FF-FF-FF
From AA-AA-AA-AA-AA-AA
address. Who is 10.10.10.55?

First, let me
check my ARP That’s not
cache...Nope, no 10.10.10.200 me,
MAc add there. CC-CC-CC-CC-CC-CC discarding
the frame.
Sending
broadcast
Sending
ARPbroadcast
message
ARP
message
Example: What is ARP?
ARP Diagram Frame RECAP:
ARP Reply
- ARP is a useful protocol for building the
received, ARP Reply to AA-AA-AA-AA-AA-AA ARP table
updating From BB-BB-BB-BB-BB-BB - Looking at ARP tables on hosts and
cache I am 10.10.10.55. networking equipment is a good
troubleshooting tool.
ARP Reply to AA-AA-AA-AA-AA-AA
- Gratuitous ARP is helpful for updating
From BB-BB-BB-BB-BB-BB the network automatically after an IP
I am 10.10.10.55.
change on a host
- RARP no longer exists
10.10.10.105 10.10.10.55
AA-AA-AA-AA-AA-AA BB-BB-BB-BB-BB-BB

10.10.10.200
CC-CC-CC-CC-CC-CC
Net Layer: IP addressing (5) - Looking up IP addresses

https://whatismyipaddress.com/

Which IP addresses are valid? Explain.

● 123.456.123.456
● 257.70.312.49
● 8.8.8.8
● 192.168.1.1
What happens to the TTL field of an IP datagram every time it reaches a router?
The TTL field is used for a CRC.
The TTL field is decremented by one.
The TTL field is reset to zero.
The TTL field is incremented by one.
( At every router hop, the TTL field is decremented by one until it reaches zero, causing the
datagram to be discarded.)

You might also like