Prog3 - CSc 252 Program 3 Version 1.0 Program 3: Bit...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
CSc 252 Program 3 Version 1.0 1 of 4 Program 3: Bit Shifting and Masking Program due: Thursday, October 27th, 11:59p.m. Write a program named prog3.s . The program will print individual fields from one or more network message headers. We will use the Internet Protocol (IP) network header in this program. Each IP message that travels over the Internet has one of these headers on it. Each header consists of five 32-bit words. These five words contain the following information: Each line in the drawing represents one of the five words of the header. The words appear in the message in the order shown from top to bottom. The numbers across the top show the order of the bits within each word. Most of the fields are a multiple of 4 bits in size (4, 8, 16, or 32). The two exceptions are the Flags field, which has 3 bits, and the Offset field, which has 13 bits. Your program will print and label the value in each field. We will provide a variable number of headers. Each provided header will consist of five words. The label headers will mark the first header. The label numHeaders will be a word that will state the number of headers in the program. Here is an example: .data numHeaders: .word 2 headers: .word 0x45000030 # contains the Version, Hlen, TOS, and Length fields .word 0x127b4000 # contains the Ident, Flags, and Offset fields .word 0x8006a223 # contains the TTL, Protocol, and Checksum fields .word 0xc0a80065 # IP address of the sender .word 0x80990483 # IP address of the receiver .word 0x4500002c .word 0x58d94000 .word 0xea06f1c8 .word 0x80990483 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 Version Hlen TOS Type of Service Length Ident Offset Flags Checksum TTL Time to Live Protocol Source Address Destination Address 1 1 1 1 1 1 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1
Background image of page 1

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

View Full DocumentRight Arrow Icon
CSc 252 Program 3 Version 1.0 2 of 4 .word 0xc0a80065
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/28/2012 for the course CSC 252 taught by Professor Moon during the Fall '11 term at University of Arizona- Tucson.

Page1 / 4

Prog3 - CSc 252 Program 3 Version 1.0 Program 3: Bit...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online