0% found this document useful (0 votes)
21 views28 pages

Lecture 06 (Reading)

The document outlines the concepts of distributed systems, focusing on networking and routing in the context of distributed and cloud computing. It discusses the architecture of the Internet, including the five-layer networking stack, routing algorithms like distance-vector and link-state, and the functionality of the transport layer. Additionally, it covers the Domain Name System (DNS), its hierarchical structure, and the mechanisms for name resolution and caching.

Uploaded by

sl0th
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views28 pages

Lecture 06 (Reading)

The document outlines the concepts of distributed systems, focusing on networking and routing in the context of distributed and cloud computing. It discusses the architecture of the Internet, including the five-layer networking stack, routing algorithms like distance-vector and link-state, and the functionality of the transport layer. Additionally, it covers the Domain Name System (DNS), its hierarchical structure, and the mechanisms for name resolution and caching.

Uploaded by

sl0th
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 28

CSE-813(Distributed and Cloud Computing)

Dr. Atiqur Rahman


ড. আতিকুর রহমান
Ph.D.(CQUPT, China), MS.Engg.(CU), B.Sc.(CU)
Associate Professor
Department of Computer Science and Engineering
University of Chittagong

Lecture 5: Networking and Routing


Our
Our Distributed
Distributed System
System
Definition
Definition
Focus of this lecture

A distributed system is a collection of entities, each


of which is autonomous, programmable,
asynchronous and failure-prone, and
communicating through an unreliable
communication medium.

• Our interest in distributed systems involves


– design and implementation, maintenance, study, algorithmics
• Entity=a process on a device (PC, PDA)
• Communication Medium=Wired or wireless network

Lecture
Lecture14-2
14-2
So
So
far…
far…

• Abstract distributed system – collection of


processes over a communication medium
• Protocols/algorithms for synchronization,
snapshots, multicast, election, mutual exclusion,
failure detectors, p2p, Hadoop
• Intended to work in any distributed group of
processes
1. E.g., Group of processes on computer hosts
2. E.g., Group of processes on mobile devices
• For most of this course, we’ll focus on (1):
computer hosts over the Internet

Lecture
Lecture14-3
14-3
PCs,routers,
switches…
=nodes

links=
edges

The Internet (Internet Mapping Project, color coded by ISPs)


Lecture
Lecture14-4
14-4
Internet
Internet 5-Layer
5-Layer Networking
Networking
Stack
Stack This is where all of our distributed algorithms/techniques
run
Message
Layers

Application
Messages (UDP) or Streams (TCP)

Transport
UDP or TCP packets

Internet
IP datagrams

Data Link Layer


Network-specific frames

Underlying network

Lecture
Lecture14-5
14-5
NETWORK/INTERNET LAYER

Routing
Routing
Algorithms
Algorithms
 Nodes connected in some topology. Routing algorithm runs at
network layer in each node.
 Goal of routing algorithm:
 given the destination IP address in packet, determine the “next hop”
 thus determine the route for each packet as it travels through the net
 dynamically update routing information to reflect failures, changes (e.g.,
router joins and leaves) and congestion (overloaded router)
 Two approaches:
 Distance-vector (e.g., RIP)
 Every node knows, for each possible destination LAN, the next-hop
 Link-state (e.g., OSPF)
 Every node knows status of every “link” in the network
In both, information maintained as a table
Tables updated either
 Proactively – periodically, or
 Reactively – when a neighbor/some link status changes
Lecture
Lecture14-6
14-6
Distance
Distance Vector
Vector
Routing
Routing
• Also termed as distributed Bellman-Ford
algorithm or Ford-Fulkerson algorithm, included
in RIP (Routing Information Protocol), AppleTalk,
and Cisco routers.
– Each node/router maintains a table indexed by each
destination node. Entry gives (best known distance to
destination, best next-hop for destination)
– Once every T seconds, each router sends to each neighbor its
own entire table. Neighbor uses this to update its own table.
(proactive)

Lecture
Lecture14-7
14-7
Distance
Distance Vector
To Link Cost
Vector A 1 1

Routing
Routing D
C
4
2
2
1

E 4 1
Routing Routing
Table for A B local
Table for B
To Link Cost
Routers
B 1 1
1 B 2
C 1 2 A C
D 3 1 4
E 1 2 3 5
A local D E
6
To Link Cost
A 2 2
B 2 1
D 5 2
Link number (all links have cost=1) E 5 1
Hosts
or C local
LANs
Routing
Table for C
Lecture
Lecture14-8
14-8
Distance
Distance Vector
Vector Routing:
Routing:
Node
Node JJ Costs only (next hop omitted)

+, then min across


neighbors

Lecture
Lecture14-9
14-9
Pseudo-Code
Pseudo-Code for
for
RIP
RIP
Send: Each t seconds or when Tl changes, send Tl on each non-faulty
outgoing link.
Receive: Whenever a routing table Tr is received on link n:
for all rows Rr in Tr {
if (Rr.link not equal n) {
Rr.cost = Rr.cost + 1;
Rr.link = n;
if (Rr.destination is not in Tl) add Rr to Tl;
// add new destination to Tl
else for all rows Rl in Tl {
if (Rr.destination = Rl.destination and
(Rr.cost < Rl.cost or Rl.link = n))
Rl = Rr;
// Rr.cost < Rl.cost : remote node has better route
// Rl.link = n : remote node is more authoritative
}
} Lecture
Lecture14-10
14-10
}
Link
Link State
State
Routing
Routing
• Each router must
1. Discover its neighbors and learn their network addresses
– When a router is booted up, it learns who its neighbors
are by sending a special Hello packet on each point-to-
point link.
– The router on the other end sends back a reply.
2. Measure the delay or cost to each of its neighbors
– A router sends a special Echo packet over the link that
the other end sends back immediately. By measuring the
round-trip time, the sending router gets an RTT estimate.
3. Construct a packet telling all it has just learned.
– Broadcast this packet

Lecture
Lecture14-11
14-11
Link
Link State
State
Routing
Routing
• A router broadcasts a link-state-advertisement (LSA) packet
after booting, as well as periodically (or upon topology
change). Packet forwarded only once, TTL-restricted
• Initial TTL is very high, since need it to get to every router

Lecture
Lecture14-12
14-12
Link
Link State
State
Routing
Routing
4. Broadcast the LSA packet to all other routers.
• Each packet contains a sequence number that is incremented for each
new LSA packet sent by that source router.
• Each router keeps track of all the (source router, sequence) pairs it
sees. When a new LSA packet comes in, it is checked against these
pairs. If the received packet is new, it is forwarded on all the links
except the one it arrived on. Old LSA packets are dropped.
• The age of each packet, being stored after reception, is decremented
once per time unit. When the age hits zero, the information is
discarded. Initial age = high. Such state is often called soft state.
5. For routing a packet, since the source knows the entire
network graph, it simply computes the shortest path
(actual sequence of nodes) locally using the Dijkstra’s
algorithm. It can include the path in the packet, and
intermediate nodes simply follow this route to decide their
next hop for the packet.

Lecture
Lecture14-13
14-13
TRANSPORT LAYER

Transport
Transport Layer Layer =Transmission
=Transmission
Control
Control
• Function 0 – provide an application withProtocol
Protocol
a connection-
oriented view of the network (IP is connectionless)
• Function 1 (Message decomposition and reassembly):
Breaks messages into packets at the transmitting end and
reassembles packets into messages at the receiving end.
– E.g., using identification and fragment offset fields in IPv4 header
• Function 2 (Multiplexing and demultiplexing): Multiplexes
several lower-rate sessions, all from the same source and
all going to the same destination, into one session at the
network layer.
• Function 3 (Reliable communication): Provides reliability to
the application by acks + retransmissions in an end to end
manner
• Function 4 (End-to-end congestion/flow control): Reduces
rate at which data is sent when congestion is detected in
the network. (TCP-friendliness)
• Function 5 (Ordering): Of packets within a stream -- FIFO
• All these functionalities are a part of TCP.
Lecture
Lecture14-14
14-14
DNS:
DNS: Domain
Domain Name
Name
System
System

People: many identifiers: Domain Name System:


– Address: Mailing address, • distributed database
email address, telephone implemented in a hierarchy of
number many name servers
– Name: E.g., John Smith
• application-layer protocol that
Internet hosts, routers: is responsible for resolving
– Address: IP address (32/64 names (address/name
bit) - used for addressing translation)
datagrams
– Name: URL e.g.,
sal.cs.uiuc.edu – human-
readable format
Q: given a resource name,
how does a client find out
the IP address of the
service/server?
Lecture
Lecture14-15
14-15
DNS:
DNS: Domain
Domain Name
Name
System
System
Name Resolution: Name 
People: many identifiers: Address
– Address: Mailing address,
email address, telephone E.g.,: given a resource name,
number how does a client find out the
– Name: E.g., John Smith IP address of the
Internet hosts, routers: service/server
– Address: IP address (32/64
bit) - used for addressing
datagrams
– Name: URL e.g.,
sal.cs.uiuc.edu – human-
readable format
Name: human-readable string
Address: machine-readable
string

Lecture
Lecture14-16
14-16
DNS:
DNS: Domain
Domain Name
Name
System
System

People: many identifiers: Domain Name System:


– Address: Mailing address, • distributed database
email address, telephone implemented in a hierarchy of
number many name servers
– Name: E.g., John Smith
• application-layer protocol that
Internet hosts, routers: is responsible for resolving
– Address: IP address (32/64 names (address/name
bit) - used for addressing translation)
datagrams
– Name: URL e.g.,
sal.cs.uiuc.edu – human-
readable format
Q: given a resource name,
how does a client find out
the IP address of the
service/server?
Lecture
Lecture14-17
14-17
DNS
DNS Name
Name
Servers
Servers
Why not have a central DNS Alternative
server? • no single server has all name-
• single point of failure to-IP address mappings
• traffic volume • Hierarchy of name servers
• may be far authoritative name servers:
• maintenance difficult – for a resource, definitively stores
the mapped IP address for that
resource
Doesn’t scale! local name servers:
(WWW contains several billion – each institution/company/ISP
owns a local (default) name server
pages today)
– Receives DNS queries from host
– Caches recently seen
nameaddress mappings, and
can answer queries quickly

Lecture
Lecture14-18
14-18
DNS:
DNS: Root
Root Name
Name
Servers
Servers

• contacted by local name


server that cannot
resolve query
• root name server:
– contacts authoritative
name server if name
mapping not known
– gets mapping
– returns mapping to local
name server
• ~ 13 root name servers
worldwide (as of ‘12)

Lecture
Lecture14-19
14-19
Simple
Simple DNS
DNS root name
Example
Example server

2 4
host surf.eurecom.fr 3
wants IP address of 5
dragon.cs.uiuc.edu
1. Contacts its local DNS
server, dns.eurecom.fr
2. dns.eurecom.fr contacts local name server authoritative name server
root name server, if dns.eurecom.fr dns.cs.uiuc.edu
necessary
3. root name server contacts 1 6
authoritative name server,
dns.cs.uiuc.edu, if
necessary
Answer returned by first server requesting host dragon.cs.uiuc.edu
that is caching the mapping surf.eurecom.fr
tuple

Lecture
Lecture14-20
14-20
DNS
DNS
root name
Example
Example server

Root name server:


2 6
• may not know the
authoritative name 7 3
server
• may know intermediate
name server: whom to
contact to find
authoritative name
server local name server intermediate name server
dns.eurecom.fr dns.uiuc.edu
• Server Hierarchy
parallels URL hierarchy 4 5
1 8
.
authoritative name server
.edu .com .mil … dns.cs.uiuc.edu
requesting host
uiuc.edu mit.edu… surf.eurecom.fr

dragon.cs.uiuc.edu

Lecture
Lecture14-21
14-21
DNS:
DNS: Iterated
Iterated
Queries
Queries root name
server

recursive query: iterated


• puts burden of name 2
3 query
resolution on servers
along the way 4
• may fail if a server does
not know next server to 7
contact, or if
intermediate server fails
local name server intermediate name server
iterated query: dns.eurecom.fr dns.uiuc.edu
• contacted server replies 5 6
with name of server to 1 8
querying server
• “I don’t know this authoritative name server
resource name, but ask dns.cs.uiuc.edu
this other server” requesting host
• takes longer (more surf.eurecom.fr
longer replies) but
gives client more dragon.cs.uiuc.edu
control
Lecture
Lecture14-22
14-22
DNS:
DNS: Caching
Caching and
and Updating
Updating
Records
Records
• Once (any) name server learns mapping, it caches
mapping
– cache entries timeout (disappear) after some time
• Update/notify mechanisms: insert new DNS entries
– RFC 2136
– http://www.ietf.org/html.charters/dnsind-charter.html
– Akamai/CDNs used this extensively to redirect HTTP requests to
nearby caching servers

Lecture
Lecture14-23
14-23
DATA LINK LAYER

ARP:
ARP: Address
Address Resolution
Resolution Protocol
Protocol
between
between
IP
IP and
and Underlying
Underlying Networks
Networks
• Most hosts are attached to a LAN by an interface
board that only understands LAN addresses. For
example, every Ethernet board is equipped with a
globally unique 48-bit Ethernet address.
• The boards send and receive frames based on 48-
bit Ethernet addresses. They know nothing about
the 32-bit IP addresses.
• Address Resolution Protocol (ARP) maps the IP
addresses onto data link layer addresses (e.g.,
Ethernet).

Lecture
Lecture14-24
14-24
ARP
ARP
Example
Example Routers have multiple network
Interface cards/devices. Each interface
has a different MAC/IP address.

Lecture
Lecture14-25
14-25
AR
AR
P
P

Suppose host 1’s IP layer (192.31.65.7) gets a packet from its transport layer destined for
192.31.65.5 (host 2)?
• Host 1’s IP layer broadcasts an ARP packet onto the Ethernet asking:
``Who owns IP address 192.31.65.5?''
• Host 2 responds with its Ethernet address (E2).
• The IP layer on host 1 builds an Ethernet frame addressed to E2, puts the IP packet
in the payload field, and transmits it on the Ethernet.
• The Ethernet board of host 2 detects this frame and causes an interrupt, to deliver the packet to
the IP layer on host 2.
Thus, the packet is transmitted from host 1’s IP layer to host 2’s IP layer
Lecture
Lecture14-26
14-26
AR
AR
P
P
• The performance of ARP can be improved by
caching the broadcast results.
• Host 1 can include its own IP to Ethernet mapping
in the ARP packet.

Lecture
Lecture14-27
14-27
AR
AR
P
P

Suppose host 1’s IP layer (192.31.65.7) gets a packet from its transport layer with
destination address set to 192.31.63.8 (host 4)?
• Host 1’s IP layer broadcasts an ARP packet onto the Ethernet asking:
``Who owns IP address 192.31.63.8?''
• Router E3/F1 responds with its Ethernet address (E3).
• The IP layer on host 1 transmits an Ethernet frame addressed to E3
• The E3 Ethernet board of router F1 receives the frame and delivers it to the IP layer on F1
• F1’s IP layer knows from the destination address of 192.31.63.8 in the packet that it has to
be next sent to 192.31.60.7.
• F1’s IP layer sends an ARP on the FDDI ring for IP address 192.31.60.7.
• Router E4/F3 replies.
• F1’s IP layer transmits an FDDI frame (containing the packet) addressed to F3
• The FDDI board of F3 receives the frame, and delivers it to the IP layer.
• F3 knows from the destination address of 192.31.63.8 in the packet that it has to
be next sent out to 192.31.63.8 through the interface E4
• F3 does an ARP on the EE Ethernet for IP address 192.31.63.8
• Host 4 responds with E6
• F3 transmits the packet inside an Ethernet frame addressed to E6, and it reaches host 4’s IP layer
Lecture
Lecture14-28
14-28

You might also like