Building-Block Protocols Ning Yu Information and Computer Sciences University of Hawaii at Manoa...
-
date post
20-Dec-2015 -
Category
Documents
-
view
215 -
download
1
Transcript of Building-Block Protocols Ning Yu Information and Computer Sciences University of Hawaii at Manoa...
Building-Block ProtocolsBuilding-Block Protocols
Ning YuInformation and Computer Sciences
University of Hawaii at Manoa
Summary
Network Protocols
Building-Block Protocols
Implementation
NextPrevious
By: Edoardo S. Biagioni
To decompose the existing networking protocols into simpler components. It should be possible to easily assemble these components into functional networking protocol stacks. Use of different components or the same components in different orders would lead to different protocols.
Summary
BasicBasic
IdeaIdea
NextPrevious
Network Protocols
The abstract objects that make up the layers of a network system are called protocols.
Definition:Definition:
Host1 Host2
High-level Object
Protocol
High-level Object
Protocol
•Peer-to-peer interface
defines the form and meaning of messages exchanged between protocol peers to implement the communication service.
•Service interface
defines the operations that local objects can perform on the protocol
Protocols generally add headers as the packet moves down the stack in send side, while the
receive side removes the header as the packet moves up the stack.
Protocols generally have two types of functions:
• format functions• control functions
NextPrevious
Building - Block Protocols
lengthlength
countercounter
CRCCRC
de/multiplexingde/multiplexing
checksumchecksum
constantconstant
voidvoid
flow controlflow control
swap
… … et al.et al.
Simply adds a fixed-size
constant header to all outgoing
packets
Removes/ Adds a header for
several higher-level protocol
stacks
Adds a standard CRC
header or trailer
Simply removes a fixed-size
constant header to all outgoing
packets
lengthlength
countercounter
CRCCRC
de/multiplexingde/multiplexing
checksumchecksum
constantconstant
acknowledgementacknowledgement
flow controlflow control
swapswap
… … et al.et al.
Advantages:Advantages:
•Easy assembly of custom protocolsEasy assembly of custom protocols
Advantages:Advantages:
•Easy assembly of custom protocolsEasy assembly of custom protocols
•Explicit interaction between blocksExplicit interaction between blocks
•Easier to write, test and verify
•Explicit interaction between blocksExplicit interaction between blocks
•Easier to write, test and verify
TCPExample
flow control
de/multiplexing
connections
urgent data
acknowledgement
retransmission
bit error detection
fragmentation
resequencing
Assemble Assemblegateway/interface
fragmentation
length
de/multiplexing
routing/loop prevention
Internet addressing
version
bit error detection
type of service
IPExample
NextPrevious
Data Structure
Block’s structure
char * header
int header_size
int (* protocol_function) ( char * spaceBegin, char * dataBegin, char * dataEnd, char * spaceEnd, struct send_protocol_stack * stack);
struct send_protocol_stack * next
send_protocol_stack
NextPrevious
Data Structure
Send stack push
struct send_protocol_stack * send_stack_push( char * header, int header_size, int (* protocol_function)( char * spaceBegin, char * dataBegin, char * dataEnd, char * spaceEnd, struct send_protocol_stack * stack), struct send_protocol_stack * stack);
send _protocol_stack
header_size
header
protocol_function()
next send_protocol_stack
4
send _protocol_stack
header protocol_function() send_protocol_stackheader_size
header
protocol_function()
6send_stack_pushsend_stack_push
header_size6
send_stack_push send_stack_push
NextPrevious
send _protocol_stack
header_size
header
protocol_function()
next send_protocol_stack
4
send _protocol_stack
header_size6header
protocol_function()
send_constant
send_constant
send_constant
send_reorder
send_udp
Data Structure
Send stack push
NextPrevious
Data Structure
receive stack push
receive_check
receive_demux
receive_void
receive_reorder
receive_void
receive_save
receive_reorder
NextPrevious
Implementation
Feasibility
send_constant
send_constant
send_constant
send_gettime
send_udp
receive_void
receive_rtt
receive_void
reflectreflect
receive_udpreceive_udp
send_constant
send_constant
send_constant
send_gettime
send_udp
receive_void
receive_save
receive_void
PingPing--PongPong
Client Server
uhunix2 uhics
Ping-Ponground-trip (us) min/avg/max =3580 /3759/5192
----uhunix2.its.hawaii.edu PING Statistics----round-trip (ms) min/avg/max = 3/3/8
The average Round trip time could be more than 5 ms when more print out
added.
uhunix2 Cleo (Linux)
Ping-Ponground-trip (us) min/avg/max = 2257/3203/10625
--- uhunix2.its.hawaii.edu ping statistics ---round-trip min/avg/max = 3.8/4.8/6.2 ms
Destination Address
48bits
Type
16bits
Source Address
48bits
Ethernet
The Ethernet’s data field carries:
a minimum of 46 byes
a maximum of 1500 bytes
If there are less than 46 bytes of data, the field will be padded to the minimum length
Contains the physical address of the device that is to receive the
packet
Contains the hardware address of the device sending the packet
Indicates the type of management
information present in the packet.
NextPrevious
Simulating Ethernet Header
DestinationIP | port #
48bits
Type
16bits
SourceIP | port #
48bits
Assembly stack
Ethernet Stack
send_extend
send_trim
send_constant
send_constant
send_udp
send_constant
Ethernet send stack
receive_void
receive_demux
receive_void
IP ARP
Ethernet receive stack
ARP
The goal:
To enable each host on a network to built
up a table of mappings between
IP address and link-level addresses
Hardware type
0 16 32
ProtocolType
SourceHardwareAddr
HLEN PLEN Operation
SourceHardwareAddr SourceProtocolAddr
SourceProtocolAddr TargetHardwareAddr
TargetHardwareAddr
TargetProtocolAddr
NextPrevious
Implement ARP reply stack and request stack by using
send_constant
Implement ARP receive stack by using
receive_void receive_check
receive_save receive_switch
ARP stack
Implementation
Internet Protocol (IP)
Version
0 16 32
Length
Ident
TTL Protocol
Offset
SourceAddr
DestinationAddr
HLen TOS
Flags
Checksum
NextPrevious
IP stack Implement IP send stack by using
send_constant send_flag_offset
send_reordersend_counter
Implement IP receive stack by using
receive_demux
receive_reorder
receive_void
receive_flag_offset
Implementation
NextPrevious
A simple implementation of Building-Block Protocol
Stack Structure
Ethernet Stack
ARP Stack
IP Stack
ARP Stack
Ethernet Stack
IP Stack
table_lookup