ECE 544 Protocol Design Project 2016

ECE 544 Protocol
Design Project 2016
Nirali Shah
Thara Philipson
Nithin Raju Chandy
Network Architecture & Topology
Assumptions
●
Service Objective: k-out-of-n “packet
datagram” multicast
● Max number of destinations is 3 (N)
●Packet to be delivered to K out of N destinations
●No direct links between end-nodes
●Packet loss probability of p
●Each end node is attached to only one router
●All links have hop cost 1 and same MTU 1500 bytes
●About 50-100 nodes and up to 256 total hosts in the network
Network Diagram
● Total Number of Nodes =
9
● Each Link has cost of 1
R10
R11
H2
R9
H5
R1
R7
R3
H3
R12
R4
R5
R2
H6
R8
R6
Sender
H1
(Sender)
When K=2
H4
Router where
copy/forward occurs
Receivers
Optimal multicast path
Addressing Scheme
How to address routers and hosts?
● There could be up to 256 end-hosts and up to 100 routers in the
network.
● We can use 8 bit addresses (1 byte) for routers and hosts.
● Host network addresses referred to as H1, H2… H255
● Router network addresses referred to as R1, R2…. R100
● We can uniquely identify a host by addressing like H1.N1
Protocol Concept
● Our Protocol will first find the best “k” (out of N)
destinations for a given sender S.
●It then finds the best multicast distribution tree
(path) connecting those k destinations such that it
minimizes the TOTAL hop cost.
●Multicast packets will have the distribution tree in
its header.
●Routers will copy and forward whenever there is
a branch in the distribution tree.
Protocol Concept
● How to find the best K destinations?
Run Dijkstra's algorithm at the sender’s designated
router and once the algorithm converges select the
first “K” hosts that are directly connected to the
routers which are nearest to the sender.
● Once the nearest routers are known, how will we
find the nearest “K” hosts?
Using centralized mapping server.
Centralized Server for
Host - Router Mapping
Centralized mapping server table
● Gives an idea about the
different hosts and the total
number of hosts attached to all
routers in the network.
Router
No: of
Connected
Hosts
Connected
Hosts
R1
0
--
● This table is populated from
“hello” messages. Each router
talks to this server periodically
and informs the list and count
of connected hosts.
R2
0
--
R3
0
--
R4
2
D1, D2
R5
2
D4, D5
R6
1
D3
● Cons:
More control overhead
Router
No: of
Conne
cted
Hosts
Connec
ted
Hosts
R1
1
H2
R2
0
--
R3
1
H3
R4
0
--
R4
0
--
R6
1
H4
Finding best K hosts
(destinations)
R2’S Routing Table
Destinat
ion
Next
Hop
Selects H2
Cost
Selects H3
2nd
least
cost
R1
1st
least
cost
R3
R3
1
R4
R3
2
R5
R3
3
R6
R3
4
R7
R3
4
R8
R3
5
R9
R3
5
R10
R3
6
R11
R3
7
R12
R3
6
R3
R2
2
0
Centralized
Router-Host
Mapping Table
Dest : H2, H3
Protocol Concept
●How to find the best multicast distribution
tree for ‘k’ known destinations? Minimum
Steiner tree
●Minimum Steiner Tree Construction
Given an undirected weighted graph G(V,E), and a set
of nodes S, it finds the minimum cost tree that spans
the nodes in S.
Protocol Concept
Steiner tree computation --> NP-complete problem.
KMB approx. Algorithm computes trees that have approximately 5%
higher costs than the cost for the minimal Steiner Tree - Nearest optimal
solution
Protocol Concept
●How KMB works?
• Starting from a graph G, a complete (every node is connected with every
other node) graph G1 is constructed.
• For G1, a minimal spanning tree (using prim’s algorithm) T1 is
constructed
• The edges in T1 are replaced by the shortest paths in G, which gives a
subgraph G2.
• For G2, a minimal spanning tree T2 is constructed.
• The branches in T2 that don’t contain nodes that are members of the MC
group are pruned.
Protocol Concept
How every router gets to know about the
multicast tree we built at the sender?
We can use some encoding scheme - Prufer Sequence
Whenever a router get the multicast packet, it checks
the prufer sequence and locally computes steiner tree
to make the decision.
Router duplicates whenever there’s a branch in the tree
(can easily be identified from duplicate entries in the
prufer sequence. Leaf nodes also. )
Protocol Concept
Prufer Sequence
N nodes to N-2 prufer code
Services provided by protocol
●
●
●
●
Router and Host Discovery
Finding K-nearest destinations
Multicast distribution tree construction
Multicast packet delivery with ACKs
ARQ
● Stop and wait Protocol.
● Sender waits for the the ACK from receiver.
● New packet is only send after sender receives ACK for the
previous packet.
● Timeout timer at sender side to ensure packet is received at
receiver.
● Receiver stores data packet and ACK in case of packet loss.
● The packets at memory are destroyed when packet with next
sequence number is received.
Protocol Design :
SYNTAX & SEMANTICS
Packets Structures:
● Hello and Hello ACK packet
Type
Subtype
Seq. Number
SRC
DEST
Payload
●
●
Type: 00
Subtype: 0 for Hello Packet, 1 for Hello ACK Packet
●
The router connected to the Host receives the Packet and sends an
ACK with SRC as its own Address and DEST as the Host’s Address.
●
This way each host discovers its default router.
● Routing Hello and ACK
●
●
Type: 01
Subtype: 0 for Hello Packet(for router), 1 for Hello ACK
Packet(for router)
Type
●
Subtype
Seq. Number
SRC
DEST
Payload
Same way the routers send Hello packets to discover their neighbor's
in order to exchange LSP packets to implement Dijikstra’s Algorithm.
● Multicast Data Packet and ACK
SEQ
NUM
TYPE
Subtype
Type: 10
•
•
•
•
•
•
SRC
DEST1
DEST2
DEST3
K
PRUFER
ENCODED
SEQ
TTL
MAX
PAYLOAD
Subtype: 0 for DATA, 1 for ACK
Once a Node receives a packet of a different Sequence Number as
well as an ACK of the same SEQ NUM, it flushes the packet.
If it receives a packet with the same SEQ NUM again, it sends the
ACK to the preceding Node and ignores the packet.
Type = 2 (8 bit) for Data Packet
Subtype = 0 for Data Packet, 1 for Data Packet ACK
SRC(8 bit) = the address of the Node that sends the packet
Each Node when receives a packet checks the Prufer Sequence to
know whether it has to accept the packet or discard it.
SEQ
NUM
TYPE
Subtype
SRC
DEST1
DEST2
DEST3
K
PRUFER
ENCODED SEQ
TTLMA
X
PAYLO
AD
● It puts itself as the SRC and forwards the Packet to the succeeding
router in the Prufer Sequence.
● The ACK is sent by the next router to the SRC address only.
● DEST1,DEST2,DEST3=all the possible destinations from which K
best destinations have to be found. Here maximum
DEST=3(assumption)
● K= Number of Hosts to which the packets are to be sent from N
Hosts.
● Prufer Encoded Sequence= Contains the best path calculated by
the Steiner Tree.
● Each router decodes the Sequence and takes a decision whether
to accept a packet or not,forwards or copies it to the next router in
the sequence.
● TTLMAX=Time after which the packet is to be killed.
● It is decremented each time it reaches a node.
● LSP Packet and ACK
The LSP Packet is flooded at the start by all the routers to its
neighbours for them to update their Routing Table till the
Dijikstra’s Algorithm converges.
SEQ NUM
TYPE
SUBTYPE
SRC
PAYLOAD
● SEQ NUM = Each LSP packet has a unique SEQ NUM.
● Router keeps track of the SEQ NUM and updates its
Routing Table periodically.
● If it gets a packet with previous sequence number it
discards it as it is not the latest info.
SEQ NUM
TYPE
SUBTYPE
SRC
PAYLOAD
● TYPE =3 for LSP Packet
● SUBTYPE= 0 for LSP packet
=1 for ACK of LSP packet
● SRC=The Address of the router which floods the LSP.
● The routers send ACK to the address in the SRC field.
● Each router checks if it gets ACK from all its
neighbouring router else resends it if the timer times out.
● Payload= a table with the routers and the costs.
Payload Table:
DEST
COST
DEST: address of all neighbors of the sender of LSP
COST: number of hops to reach the neighbors
● Packet and ACK to keep Centralized Server updated
● Each Router will check its ports at the start to check
who it is connected to.
● If it identifies a Host address then it will send a
packet to the Server to update the Host-Router
Mapping Table.
● We assume that the routers and the Host do not fail
or change in between.
TYPE
SUBTYPE
SRC
SEQ NUM
DATA
TYPE
SUBTYPE
SRC
SEQ NUM
DATA
● TYPE =4 for packets updating server table
● SUBTYPE= 0 for packet
= 1 for ACK
● SRC= Address of the router connected to a Host and
sending packet to the Server.
● The Server sends an ACK to SRC address.
● SEQ NUM= each packet will have unique sequence number.
● PAcket of same SEQ NUM is discarded.
ROUTER
HOST
● DATA=
ROUTER= routers address which is connected to one of teh
Hosts
HOST=address of the Host it is connected to.
Packets used
Hello packet and ACK
Type
Subtype
Seq. Num
SRC
DEST
Payload
SRC
DEST
Payload
Routing hello and ACK
Type
Subtype
Seq. Num
Multicast Data packet and ACK
SEQ
NUM
TYPE
Subtype
SRC
DEST1
DEST2
DEST3
K
LSP Packet
SEQ NUM
TYPE
SUBTYPE
SRC
PAYLOAD
Host to Router mapping packet and ACK
TYPE
SUBTYPE
SRC
SEQ NUM
DATA
PRUFER
ENCODED SEQ
TTL
MAX
PAYLOA
D
Estimated Size of Packets
● Hello packet and ACK
Size: 48 bits, 6 bytes
Frequency : 2sec
● Routing hello and ACK
Size: 48 bits, 6 bytes
Frequency : 2sec
● Multicast Data packet and ACK
Size: 180 bits,23 bytes (13 bytes for prufer and rest 9
bytes) 23 bytes + data
● LSP Packet
Frequency: Only once if topology is not changing
Size: 32 bits +1600 bits(16*100 bits) , 204 bytes
● Centralized server packet and ACK
Size: If maximum nodes is 5 and if all nodes are connected to 1 router the
Max packet size is 2 bytes*5 nodes =10 bytes.
Total size= 10 bytes + 4 bytes
Example Networks:
Network 1
If k=3, D1,D2, and D3 will be the destinations
R5 RT
R1 RT
R5
D1
R2
R6
S
R3
R1
D2
R6 RT
R4
R7
D3
R4 RT
R7 RT
Example Networks:
Network 2
Show how routing works for message sent to D1,D2,D3
Table:R4
Table :R1
R2
R1
D1
Table: R6
R4
S
Table:R3
R6
R3
D2
R5
D3
Summary of Sequence of Processes
● Address assignment is done for all the Hosts and the Routers.
● Hello packets are sent from all the Hosts to discover their default routers and are sent between
the routers to discover their neighbors.
● Update the Centralized Server Table for Router-Host mapping.
● User specifies the Sender Host and the number of destinations (K)
● LSP packets are reliably flooded between the routers.
● Dijkstra's Algorithm is implemented to generate the Routing table at each router and then the “k”
nearest hosts are found.
● Steiner tree builds an optimal multicast path of least total cost connecting hosts and k hosts.
● Prufer Sequence is generated for the tree and included in the multicast packet header.
● The Packets are forwarded by making use of prufer sequence and forwarding table at each router.
Summary
●
Performance
●
●
●
Highly scalable as we are using Steiner tree
Lot of overheads (LSP packets, Packets to update
centralized server)
Implementation complexity
●
Dijkstra's complexity - O(n^2)
● Steiner tree using Prim’s algorithm - O((|V| + |E|) log
|V|)
● Prufer Encoding - O(n log n) or even O(n^2)
Thank you