The document discusses the fundamental networking concepts of a typical home network including subnet mask, default gateway, and DNS server. It explains that when a user enters a URL like google.com in their browser, the DNS server is queried to convert the URL to an IP address. It then describes how the subnet mask is used to determine if the destination IP is local or not, and if not, the default gateway is used to route the packet between the LAN and internet.
2. www.innervoice.in
Agenda
• Concepts
– Subnet Mask
– Default Gateway
– DNS Server
• Context – a typical home network
• Assumptions
– Familiarity with DHCP fundamentals
– Familiarity with OSI stack for networking.
2
3. www.innervoice.in
A typical home network
3
ISP’s Network Internet
google.com Web
ServerDNS Server
Gateway
DSL or
Cable
RJ-45PortsforLAN
DHCP
Server
4. www.innervoice.in
Understanding Network Configuration
4
• As you can see the common information is
– Subnet Mask
– Default Gateway (Windows), Router (IPad) and Default Route
(Ubuntu)
– DNS Servers (Windows), DNS (IPad) and Primary DNS (Ubuntu)
5. www.innervoice.in
OSI Stack View of our Network
5
ISP’s Network Internet
google.com Web
ServerDNS Server
PHYSICAL
DATA LINK
NETWORK
TRANSPORT
APPLICATION
PRESENTATION
SESSION
Home Computer
PHYSICAL
DATA LINK
NETWORK
TRANSPORT
Home Router
Wired/Wireless
connection
PHYSICAL
DATA LINK
NETWORK
TRANSPORT
APPLICATION
PRESENTATION
SESSION
Google Web Server
Internet Internet
DNS Server
PHYSICAL
DATA LINK
NETWORK
TRANSPORT
APPLICATION
PRESENTATION
SESSION
Gateway
RJ-45PortsforLAN
DHCP
Server
DSL or
Cable
6. www.innervoice.in
The first step…
• What happens when you type
www.google.com on you browser?
• Application Layer: Browser will create a HTTP get request
• Network Layer: Needs to create an Network layer packet
(IP Packet) to be sent to www.google.com.
• But Network Layer needs IP Address not
URL.
• This is where DNS Server comes into picture
6
7. www.innervoice.in 7
PHYSICAL
DATA LINK
NETWORK
TRANSPORT
APPLICATION
PRESENTATION
SESSION
Home Computer
PHYSICAL
DATA LINK
NETWORK
TRANSPORT
Home Router
ISP’s
Network Internet
The browser sends a request to local
DNS Client application to convert the
URL of google.com to an IP address.
DNS Server
PHYSICAL
DATA LINK
NETWORK
TRANSPORT
APPLICATION
PRESENTATION
SESSION
Communicating with DNS Server
An IP Packet is constructed containing:
• Source IP: Home Computer
• Destination IP: DNS Server
The DNS Server IP is part of network
configuration (DHCP response)
The IP Packet or the L3 Packet is then
wrapped into an L2 Frame and sent on the
wire to the DNS Server.
The DNS Server then responds back with
the IP Address of google.com
8. www.innervoice.in
L3 to L2 Conversion
• Layer 3 or L3 uses IP Address of a device
• Layer 2 or L2 uses Physical Address of a device
– For Ethernet the physical address is the MAC address of the Network
Port.
• An L2 frame = Entire L3 packet + Some L2 information. The most
important are:
– source MAC address
– destination MAC address
• In our example,
– the source MAC address = Home computer MAC address
– But how can we find the destination MAC address?
8
9. www.innervoice.in
Destination MAC Address Flow
9
Apply ‘subnet mask’ on
destination IP Address (DNS
Server)
Is the resulting IP in
the same sub-
network as the
source IP Address?
Assume Destination
IP = Default
Gateway IP
Yes
No
Use ARP Tables to
lookup MAC address
for the Destination
IP
Construct L2
Frame with
Destination MAC
In our example, the IP address of the DNS Server
is outside the home computer's sub-network.
Hence Destination MAC address = MAC address
of the ‘Default Gateway’.
10. www.innervoice.in
The role of Default Gateway (Router)
• Default gateway is used for 'routing' network packets between one more
LANs or between a LAN and a WAN.
10
Examine the incoming L2
Frame
Does the destination
MAC address contain
my MAC address?
Drop the packet
Yes
No
Extract the L3 Packet
from the L2 Frame
Forward/Route the L3
Packet based on
Destination IP Address
Note: while forwarding L3 Packets:
Source IP = Home Computer IP
Destination IP = DNS Server IP
11. www.innervoice.in
What happens to incoming L3 packet?
11
Examine the incoming L3
Packet (destined for Home
Computer)
Can I reach the
destination IP on my
LAN?
Drop the packet
Yes
No
Convert an L3 Packet
to an L2 Frame
Forward the L2 Frame
based on Destination
MAC Address
Note: while forwarding L2 Frames:
Source IP = DNS Server IP
Destination IP = Home Computer IP
Source MAC = Default Gateway MAC
Destination MAC = Home Computer MAC
12. www.innervoice.in 12
PHYSICAL
DATA LINK
NETWORK
TRANSPORT
APPLICATION
PRESENTATION
SESSION
Home Computer
PHYSICAL
DATA LINK
NETWORK
TRANSPORT
Home Router
ISP’s
Network Internet
The browser sends a request to local
DNS Client application to convert the
URL of google.com to an IP address.
DNS Server
PHYSICAL
DATA LINK
NETWORK
TRANSPORT
APPLICATION
PRESENTATION
SESSION
Communicating with DNS Server
An IP Packet is constructed containing:
• Source IP: Local Computer
• Destination IP: DNS Server
The DNS Server IP is part of network
configuration (DHCP response)
After IP to MAC lookup the L2 packet will contain
the following address information:
Source IP = Home Computer IP
Destination IP = DNS server IP
Source MAC = Home Computer MAC
Destination MAC = Default Gateway MAC
The L2 Packet received by the Home Router since
its MAC address was in the destination address.
The L3 packet inside this L2 frame tells the
‘Gateway’ or ‘Router’ to forward the packet to
the DNS Server.
The DNS Server then responds back with
the IP Address of google.com
13. www.innervoice.in
And it starts all over again
• At this stage the home computer has the IP address of
www.google.com
• Next the L3 frame meant for www.google.com is
constructed.
• Once again the whole process of L3 to L2 frame
conversion and IP-to-MAC lookup will take place.
• And just like DNS server responded to a DNS request, the
Google Web Server will respond to a HTTP Get request.
13
14. www.innervoice.in
Summary
• DNS Server is used to convert a URL to an IP
address
• Subnet Mask is used for determining whether IP
to MAC lookup should be done or not.
• Default Gateway is the entity that routes
packets from LAN to WAN (ISP/Internet) and
vice-versa
14