{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Lecture16

# Lecture16 - Thursday May 22 Homework#4 is due Lab#5 is...

This preview shows pages 1–12. Sign up to view the full content.

1 Thursday, May 22 Homework #4 is due Questions? Solutions will be posted today Lab #5 is posted Due Friday, May 30 Lab schedule is changed!! Program #2 is posted Due Thursday, June 5 (2 weeks from today!) Partnership registration due Tuesday (5/27)

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
2 Summer Employment Linux kernel development Device drivers, etc Up to 40 hours per week See me if you’re interested
3 Today's Topics Notes on Program #2 More ICMP DHCP IPv6 Intro to the Link Layer

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
4 Program #2 DNS query requires sending both character and numeric  data Don’t try to use C string functions on numeric data Keep count of actual number of bytes Some numeric data is 2-byte, 4-byte Some numeric values must be stored as a single byte Use buff[i] = (char)x; And … (as if that were not bad enough) …
5 Byte-ordering In all modern computer architectures, strings  are stored in  contiguous memory addresses in byte (character) order However … storage of numeric values  is architecture dependent 16-bit integer (2 bytes) 32-bit integer (4 bytes) etc. Different architectures store numeric values in different byte  order

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
6 Big-endian, Little-endian Big-endian Numeric (multi-byte) values are stored in "normal" byte order most significant byte first Example: Decimal 1523 = 05F3 (hex) Big-endian  byte order is  05  F3 Little-endian Numeric (multi-byte) values are stored in "reverse" byte order least significant byte first Example: Decimal 1523 = 05F3 (hex) Little-endian  byte order is  F3  05 NOTE: this refers to byte-order, NOT to the order of bits within the  bytes.
7 Big-endian, Little-endian Example: 32-bit dotted-decimal 128.193.35.203 = 80C123CB  (hex) Big-endian  byte order is  80  C1  23  CB Little-endian  byte order is  CB  23 C1  80

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
8 Big-endian, Little-endian Intel  architectures use  little-endian Sparc, Solaris  (and other) architectures use  big-endian Problem with communication among various architectures.
9 Network communication Data sent over a network is a sequence of bytes (characters,  integers, etc.) Network order is  always  Big-endian Linux provides some functions to convert host order    network order. #include <netinet/in.h> ntohs, htons : 16-bit network-to-host and host-to-network ntohl, htonl :  32-bit network-to-host and host-to-network inet_ntoa :  converts address  in network byte order  to a string   in dotted-decimal notation.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
10 Questions on Program #2?
11 Informational messages Echo request/reply Sent to ICMP software on any computer In response to a  request

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}