程序代写代做代考 python PowerPoint Presentation – Slide 1

PowerPoint Presentation – Slide 1

OVERVIEW
INTERNET CONTROL MESSAGE PROTOCOL
vumanfredi@wesleyan.edu
1

chapter goals:
understand principles behind network layer services, focusing on data plane:
network layer service models
forwarding versus routing
how a router works
generalized forwarding
instantiation, implementation in the Internet

1

Internet Control Message Protocol (ICMP)
Used by hosts & routers to communicate network-level information
error reporting
unreachable host, network, port, protocol
echo request/reply
used by ping
network-layer above IP
ICMP msgs carried in IP pkts

ICMP message
type, code plus first 8 bytes of IP pkt causing error
Type Code Description
0 0 echo reply (ping)
3 0 dest. network unreachable
3 1 dest host unreachable
3 2 dest protocol unreachable
3 3 dest port unreachable
3 6 dest network unknown
3 7 dest host unknown
4 0 source quench (congestion
control – not used)
8 0 echo request (ping)
9 0 route advertisement
10 0 router discovery
11 0 TTL expired
12 0 bad IP header

2

Traceroute and ICMP
Source sends series of segments or packets to destination
first set has TTL =1
second set has TTL=2, etc.
unlikely port number

When nth set arrives to nth router
router discards and sends source ICMP message (type 11, code 0)
ICMP message includes name of router & IP address
When ICMP msg arrives
source records RTTs

Stopping criteria
TCP segment or UDP datagram eventually arrives at dst host
dst returns ICMP “port unreachable” message
source stops

3 probes
3 probes
3 probes

Q: why can traceroute work with segments, datagrams, or packets?
3

Traceroute Example Implementations
Send segments using ICMP echo
Intermediate routers
respond with ICMP TTL expired

Final destination
responds with ICMP echo reply

Send UDP or TCP segments
Intermediate routers
respond with ICMP TTL expired

Final destination
responds with ICMP “port unreachable” message

4

Ping Implementations
Sender
Send ICMP echo with the current timestamp

Destination Send UDP or TCP segments
Send ICMP reply (with the original payload in ICMP echo copied)

Sender
Get the current time
Get the time carried in ICMP reply
Difference: one instance of RTT

5

BIT-WISE OPERATIONS IN PYTHON
NETWORK PROGRAMMING
vumanfredi@wesleyan.edu
6

chapter goals:
understand principles behind network layer services, focusing on data plane:
network layer service models
forwarding versus routing
how a router works
generalized forwarding
instantiation, implementation in the Internet

6

Bit-wise operations on variables
x << y returns x with bits shifted to left by y places new bits on right-hand-side are zeros same as multiplying x by 2y x >> y
returns x with bits shifted to right by y places
same as dividing x by 2y
x & y
does a bitwise and
each bit of output is 1 if corresponding bit of x AND of y is 1, otherwise 0
~ x
returns complement of x
number you get by switching each 1 for 0 and each 0 for 1
E.g.,
use to pack ip_version and ip header length into 8 bits

7
https://wiki.python.org/moin/BitwiseOperators
https://www.tutorialspoint.com/python3/bitwise_operators_example.htm

/docProps/thumbnail.jpeg