Lecture 20: Network Primer 7/8/2003 CSCE 590 Summer 2003.

Slides:



Advertisements
Similar presentations
Discussion Monday ( ). ver length 32 bits data (variable length, typically a TCP or UDP segment) 16-bit identifier header checksum time to live.
Advertisements

IP Fragmentation. MTU Maximum Transmission Unit (MTU) –Largest IP packet a network will accept –Arriving IP packet may be larger IP Packet MTU.
CSE 461: IP/ICMP and the Network Layer. Next Topic  Focus:  How do we build large networks?  Introduction to the Network layer  Internetworks  Service.
ISO/OSI Model Layers Application: applications that use the network. This is were mail, browsers, ftp, etc reside Presentation: data formats, character.
CompTIA Network+ Chapter 2
Chapter 20 Network Layer: Internet Protocol Stephen Kim 20.1.
Network Layer Packet Forwarding IS250 Spring 2010
1 TDC TDC 365 Network Interconnections Technologies Lecture #4 Notes Spring, 2009.
CS335 Networking & Network Administration Tuesday, May 11, 2010.
CSEE W4140 Networking Laboratory Lecture 6: TCP and UDP Jong Yul Kim
Source Port # (16)Destination Port # (16) Sequence Number (32 bits) Acknowledgement Number (32 bits) Hdr Len (4) Flags (6)Window Size (16) Options (if.
ITIS 6167/8167: Network and Information Security Weichao Wang.
Chapter 3 Review of Protocols And Packet Formats
Defining Network Protocols Application Protocols –Application Layer –Presentation Layer –Session Layer Transport Protocols –Transport Layer Network Protocols.
Module 10. Internet Protocol (IP) is the routed protocol of the Internet. IP addressing enables packets to be routed from source to destination using.
4: Network Layer4a-1 IP datagram format ver length 32 bits data (variable length, typically a TCP or UDP segment) 16-bit identifier Internet checksum time.
Petrozavodsk State University, Alex Moschevikin, 2003NET TECHNOLOGIES Internet Control Message Protocol ICMP author -- J. Postel, September The purpose.
© Janice Regan, CMPT 128, CMPT 371 Data Communications and Networking Network Layer ICMP and fragmentation.
G64INC Introduction to Network Communications Ho Sooi Hock Internet Protocol.
The Network Layer. Network Projects Must utilize sockets programming –Client and Server –Any platform Please submit one page proposal Can work individually.
TCOM 509 – Internet Protocols (TCP/IP) Lecture 03_a
Exploring the Packet Delivery Process Chapter
TCOM 515 IP Routing Lab Lecture 1. Class information Instructor: Wei Wu –Lecture and Lab session 2 – Instructor:
Introduction to Networks CS587x Lecture 1 Department of Computer Science Iowa State University.
CDPA 網管訓練 駭客任務 2 Ethernet Switching ARP, IP, LAN, Subnet IP Header, Routing ICMP
TCP/IP Basic Theory V1.2. Course Outline OSI model and layer function TCP/IP protocol suite Transfer Control Protocol Internet Protocol Address Resolution.
Fall 2005Computer Networks20-1 Chapter 20. Network Layer Protocols: ARP, IPv4, ICMPv4, IPv6, and ICMPv ARP 20.2 IP 20.3 ICMP 20.4 IPv6.
Suez Canal University – Faculty of Computers & Informatics - Cisco Local Academy Network Fundamentals.
Lecture 3 Overview. Protocol An agreed upon convention for communication both endpoints need to understand the protocol. Protocols must be formally defined.
ECE 526 – Network Processing Systems Design Networking: protocols and packet format Chapter 3: D. E. Comer Fall 2008.
Protocols 1 Objective: Build a protocol foundation for Client / Server programming in an Internet Environment Note: RFCs available from
TCOM 515 IP Routing. Syllabus Objectives IP header IP addresses, classes and subnetting Routing tables Routing decisions Directly connected routes Static.
Chapter 81 Internet Protocol (IP) Our greatest glory is not in never failing, but in rising up every time we fail. - Ralph Waldo Emerson.
Internetworking Internet: A network among networks, or a network of networks Allows accommodation of multiple network technologies Universal Service Routers.
CS4550 Computer Networks II IP : internet protocol, part 2 : packet formats, routing, routing tables, ICMP read feit chapter 6.
Internetworking Internet: A network among networks, or a network of networks Allows accommodation of multiple network technologies Universal Service Routers.
TCP/IP Honolulu Community College Cisco Academy Training Center Semester 2 Version 2.1.
Internet Protocols. Address Resolution IP Addresses are not recognized by hardware. If we know the IP address of a host, how do we find out the hardware.
© 2007 Cisco Systems, Inc. All rights reserved.Cisco Public 1 OSI Network Layer Network Fundamentals – Chapter 5.
Network Layer4-1 Datagram networks r no call setup at network layer r routers: no state about end-to-end connections m no network-level concept of “connection”
Chapter 21 IP Encapsulation, Fragmentation, and Reassembly.
Lecture 4 Overview. Ethernet Data Link Layer protocol Ethernet (IEEE 802.3) is widely used Supported by a variety of physical layer implementations Multi-access.
1 Bus topology network. 2 Data is sent to all computers, but only the destination computer accepts 02608c
1 Connectivity with ARP and RARP. 2 There needs to be a mapping between the layer 2 and layer 3 addresses (i.e. IP to Ethernet). Mapping should be dynamic.
1 Internetworking: IP Packet Switching Reading: (except Implementation; pp )
© Jörg Liebeherr (modified by M. Veeraraghavan) 1 Point-to-Point Protocol Data Link Layer Loopback ARP and RARP.
Network Layer 3 Application Presentation Session Transport Network Data Link Physical OSI Model.
Lecture 21: Network Primer 7/9/2003 CSCE 590 Summer 2003.
The OSI Model. Understanding the OSI Model In early 1980s, manufacturers began to standardize networking so that networks from different manufacturers.
Network Layer Protocols COMP 3270 Computer Networks Computing Science Thompson Rivers University.
IP Fragmentation. Network layer transport segment from sending to receiving host on sending side encapsulates segments into datagrams on rcving side,
Chapter 20 Network Layer: Internet Protocol Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Packet Switch Network Server client IP Ether IPTCPData.
1 Layer 3: Routing & Addressing Honolulu Community College Cisco Academy Training Center Semester 1 Version
IP - Internet Protocol No. 1  Seattle Pacific University IP: The Internet Protocol Kevin Bolding Electrical Engineering Seattle Pacific University.
© 2003, Cisco Systems, Inc. All rights reserved.
Introduction to Networks v6.0
Instructor Materials Chapter 5: Ethernet
Scaling the Network: The Internet Protocol
Part I. Overview of Data Communications and Networking
TCP/IP Transmission Control Protocol / Internet Protocol
Net 323: NETWORK Protocols
CS 457 – Lecture 10 Internetworking and IP
Internet Protocol (IP)
Net 323 D: Networks Protocols
Scaling the Network: The Internet Protocol
Networking Essentials For Firewall-1 Administrators
ITIS 6167/8167: Network and Information Security
Based on notes from D. Hollinger
32 bit destination IP address
Presentation transcript:

Lecture 20: Network Primer 7/8/2003 CSCE 590 Summer 2003

Obligatory 7 Layer OSI Model Open Systems Interconnection Model –End to End Layers: 7 – Application: interfaces directly with the user 6 – Presentation: provides data independence (different representation of numbers, network byte order) 5 – Session: establishes, manages and terminates connections between applications 4 – Transport: end-to-end error recovery and flow control –Point to Point Layers: 3 – Network: creating logical paths for transmitting data from node to node; i.e. routing, switching 2 – Link: logical organization of data bits transmitted on a particular medium 1 – Physical: physical properties of communications media

4 (5) Layer IP Model IP is older than OSI Model, so IP doesn’t exactly fit it –Application – SSH, DNS –Transport – TCP, UDP –Network - IP –Link/Physical – device drivers/wires and electricity

Packets and Frames Like envelopes within envelopes Frames = hardware layers –Ethernet –ATM –Tokenring Packets = software layers –IP –IPX

Frames Has header and trailer –Trailer 4 bytes –Cyclic Redundancy Check (CRC) Frame header used for synchronization –Tells NIC where frame begins so it can start pulling data –14 bytes Frame data is packet for next layer Max 1518 bytes, min 64 bytes

Ethernet Frame Header IEEE Ethernet frame Layer 2 Start Delimiter Destination MAC Address Preamble Length Source MAC Address Data Field Frame CRC Pad Field … bytes 1 byte 6 bytes 2 bytes 4 bytes Min: 64 bytes Max: 1518 bytes MAC Header Layer 3+

Ethernet Frame Fields Alternating 0’s and 1’s in preamble to synchronize Start delimiter has last 2 bits as 11 Length of data field does not include any padding to get minimum size –In Ethernet II, is the Type field, value > 1500 represents which memory buffer on dst it stored in = protocol of data field (IP = hex 0800) MAC addresses –48 bit hardware address of Network Interface Card –First 3 bytes are the Organizationally Unique Identifier (OUI) of NIC manufacturer –All ones signifies broadcast address CRC does not include preamble and start delimiter

Trace of Ethernet Header tcpdump –en –XX –s 1518 –i eth0 |more Ethernet II: Protocol=IP; Not packet length

Encapsulation and Decapsulation One layer’s header is part of another layer’s data Frame Header DATA TCP Header IP Header DATA TCP Header DATA IP Header DATA Frame Header DATA Frame Footer

Bridging the Layers How do we get from hardware MAC address at Layer 2 to IP address at Layer 3? Address Resolution Protocol (ARP) –We don’t want a permanent mapping between MAC address and IP address, needs to be dynamic –ARP allows us, given an IP address, to find the physical address of the host with that IP address

ARP IP addresses are used to route a packet to its final destination MAC addresses are used to travel from intermediate hop to intermediate hop MAC Addresses are stripped and replaced from the frame at each hop. –Next hop becomes new destination –Current hop becomes new source IP routing provides which hop is next, MAC addresses and ARP get the frame there

ARP Packet Format Opcode Source Protocol Address Hardware Type Target Protocol Address Protocol Type Source Hardware Address Target Hardware Address (cont) Hardware LengthProtocl Addr Len Source Hardware Address (cont) Target Hardware AddressSource Protocol Address (cont)

ARP Packet Fields Hardware Type: –Ethernet = 1 –ATM = 16 Protocol Address Type –IP = 0x0800 Hardware Address Length: length of hardware address in bytes Protocol Address Length: length of hardware address in bytes Operation Code: 1 = Request, 2 = Reply

ARP Request Each machine keeps a local ARP cache of IP address-MAC address mappings for about 120 seconds each If an IP address is not in its cache, it broadcasts an ARP Request to all machines on the local network Non-target machines receiving broadcast may cache sender’s MAC and IP addresses to help reduce broadcast traffic Destination MAC address is all 1’s arp who-has tell

ARP Reply The machine that has that IP address, issues an ARP Reply It also caches the requestor’s IP and MAC addresses Requestor gets response and caches it arp reply is-at 00:06:de:ad:be:ef Many machines will cache an unsolicited arp reply which can enable ARP spoofing and sniffing on switched networks

Malicious ARP Spoofing Unsolicited ARP reply Man-in-the-Middle arp reply is-at 00:00:de:ad:be:ef :00:de:ad:be:ef ARP Cache Contents Afterwards: = 00:00:de:ad:be:ef

Malicious ARP Sniffing on Switched Networks ARP spoof the default gateway of the subnet sending to the switch Switch will have 2 entries for default gateway in cache, and will send each packet to both Or on older switches, you could flood ARP cache with bogus entries, causing the switch to fail open, like a hub. Sends each packet to all ports

Switch Sniffing arp reply is-at 00:00:de:ad:be:ef :00:de:ad:be:ef ARP Cache Contents Afterwards: = 00:00:da:da:be:ee = 11:11:de:ad:be:ef 11:11:da:da:be:ee

Packets Packets have positional fields Predefined number of bits allocated to each field Some optional fields vary in size –Other fields describe their length –Example is data field No footers like with frames

IP Header Total Length in Bytes Fragment Offset (13 bits) Header Checksum IP Identification Number (Frag ID) Source IP Address Destination IP Address TTLIP Protocol Type of ServiceVersion Options (Variable Length 0-40 bytes, padded with 0’s) R DFDF MFMF Hdr Len

IP Header Fields Version: 4 bits, version of IP, usually 4, but 6 is becoming more common Header Length: 4 bits, Length of IP header in 32- bit (4 byte) words –Maximum of 60 words –Commonly 5 words (with no IP options) Type of Service (TOS): 8 bits, nominally the type of service the packet should receive Total Length: 16 bits, total length of IP packets in bytes. Max possible bytes

IP Fragmentation Need fragmentation because not all networks’ MTUs (Maximum Transition Units) are the same Occurs when MTU is smaller than datagram Reassembled at destination host Each fragment in encapsulated in an IP datagram Can be used to bypass routers and IDS

IP Fragmentation IP fragmentation fields: –Fragmentation ID, Offset, and Flags –Fragments must share a common fragment identification number –Must tell the offset of this data fragment in original unfragmented datagram –Must tell length of data in this fragment –Must tell whether more fragments are to follow

Fragment ID Field Each IP packet has a unique IP Identification number Increments by 1 for each datagram in a session In a fragmented packet, each datagram fragment retains the original IP ID Number as a Fragment ID Number. This identifies a fragment as belonging to an original datagram to the reassembling host

Fragmentation Flags Three bit flag field Bit 0 is reserved and not used Bit 1: DF – Don’t Fragment when set to 1 –What if fragmentation is needed? A router will send back an ICMP unreachable – need to fragment packet to the source with the size of the maximum MTU Bit 2: MF – More Fragments when set to 1

Fragmentation Offset Field 13 bit field Tells the receiving system where the datagram belongs in the original datagram so that it can be reconstructed From the perspective of IP data field: TCP, ICMP, UDP fields are included in the offset

Fragmentation Example On Windows: –ping –n 1 –l

Fragmentation Example The Math Ethernet = 1500 bytes Each IP header takes 20 bytes So 1480 bytes of data in each fragment The total packet size we have to break up is 3300 data bytes + 20 bytes IP header + 8 bytes ICMP header = 3328 bytes First fragment gets IP header and ICMP header and ( ) 1472 bytes data The rest of the fragments do not have the ICMP header

Fragmentation Example 1.20 bytes IP, 8 bytes ICMP, 1472 bytes data fragment ID = 4620, length = 1480 offset = 0, MF = – 1472 = 1828 bytes remaining 2.20 bytes IP, 1480 bytes data fragment ID = 4620, length = 1480 offset = 1480, MF = – 1480 = 348 bytes remaining 3.20 bytes IP, 348 bytes data fragment ID = 4620, length = 348 offset = 2960, MF = 0 0 bytes remaining

Malicious Fragmentation Fragmenting to blind IDS –Never sends final piece –Or piece missing in middle –Some IDS reconstruct fragmented packets to ‘normalize’ them and check against signatures –Only so much memory assigned to it –Or a limited number of fragmented packets can be reconstructed at once If IDS does not normalize, split attack up into frags and it won’t match signatures

Ping of Death Denial of Service Very large datagram crafted using fragments When reassembled by victim, the maximum IP datagram size of is exceeded Causes crashes, system hangs, BSOD Is *OLD*, all vendors should have a patch

Teardrop Attack What’s wrong with this picture? 1.evilfragger.org.139 > target.edu.139: udp 28 (frag 2.evilfragger.org > target.edu: (frag Remember (frag It reboots or crashes some unpatched machines

Teardrop Attack 1.evilfragger.org.139 > target.edu.139: udp 28 (frag 2.evilfragger.org > target.edu: (frag Fragment 2 Fragment 1 Byte 0Byte 24 Byte 27 Byte 35 (frag (frag

References Read Chapter 6