Packet Analysis with Wireshark

Slides:



Advertisements
Similar presentations
CISCO NETWORKING ACADEMY Chabot College ELEC Transport Layer (4)
Advertisements

Intermediate TCP/IP TCP Operation.
Introduction1-1 message segment datagram frame source application transport network link physical HtHt HnHn HlHl M HtHt HnHn M HtHt M M destination application.
CSEE W4140 Networking Laboratory Lecture 6: TCP and UDP Jong Yul Kim
CSE551: Computer Network Review r Network Layers r TCP/UDP r IP.
Instructor: Sam Nanavaty TCP/IP protocol. Instructor: Sam Nanavaty Version – Allows for the evolution of the protocol IHL (Internet header length) – Length.
1 Chapter 3 TCP and IP. Chapter 3 TCP and IP 2 Introduction Transmission Control Protocol (TCP) Transmission Control Protocol (TCP) User Datagram Protocol.
CP476 Internet Computing TCP/IP 1 Lecture 3. TCP / IP Objective: A in-step look at TCP/IP Purposes and operations Header specifications Implementations.
CS3505 The Internet and Info Hiway transport layer protocols : TCP/UDP.
The Network Layer Chapter 5. The IP Protocol The IPv4 (Internet Protocol) header.
Chapter 5 The Network Layer.
CSEE W4140 Networking Laboratory Lecture 6: TCP and UDP Jong Yul Kim
1 Application TCPUDP IPICMPARPRARP Physical network Application TCP/IP Protocol Suite.
Institute of Technology Sligo - Dept of Computing Semester 2 Chapter 9 The TCP/IP Protocol Suite Paul Flynn.
Defining Network Protocols Application Protocols –Application Layer –Presentation Layer –Session Layer Transport Protocols –Transport Layer Network Protocols.
IP-UDP-RTP Computer Networking (In Chap 3, 4, 7) 건국대학교 인터넷미디어공학부 임 창 훈.
Gursharan Singh Tatla Transport Layer 16-May
IST 228\Ch3\IP Addressing1 TCP/IP and DoD Model (TCP/IP Model)
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.
Network Layer4-1 NAT: Network Address Translation local network (e.g., home network) /24 rest of.
© Janice Regan, CMPT 128, CMPT 371 Data Communications and Networking Network Layer ICMP and fragmentation.
TCP/IP Protocol Suite Networks and Protocols Prepared by: TGK First Prepared on: Last Modified on: Quality checked by: Copyright 2009 Asia Pacific Institute.
TCP/IP Essentials A Lab-Based Approach Shivendra Panwar, Shiwen Mao Jeong-dong Ryoo, and Yihan Li Chapter 5 UDP and Its Applications.
Introduction to Networks CS587x Lecture 1 Department of Computer Science Iowa State University.
Chap 9 TCP/IP Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology
Chapter 4 TCP/IP Overview Connecting People To Information.
1 LAN Protocols (Week 3, Wednesday 9/10/2003) © Abdou Illia, Fall 2003.
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.
1 Transport Protocols Relates to Lab 5. An overview of the transport protocols of the TCP/IP protocol suite. Also, a short discussion of UDP.
The Transport Layer application transport network data link physical application transport network data link physical application transport network data.
Review the key networking concepts –TCP/IP reference model –Ethernet –Switched Ethernet –IP, ARP –TCP –DNS.
CCNA 1 v3.0 Module 11 TCP/IP Transport and Application Layers.
Internet Protocol ECS 152B Ref: slides by J. Kurose and K. Ross.
Internetworking Internet: A network among networks, or a network of networks Allows accommodation of multiple network technologies Universal Service Routers.
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.
1 Network Layer Lecture 16 Imran Ahmed University of Management & Technology.
Basic IP Protocol Natawut Nupairoj, Ph.D. Department of Computer Engineering Chulalongkorn University.
Transport Layer3-1 Chapter 4: Network Layer r 4. 1 Introduction r 4.2 Virtual circuit and datagram networks r 4.3 What’s inside a router r 4.4 IP: Internet.
Cisco Networking Academy S2 C9 TCP/IP. ensure communication across any set of interconnected networks Stack components such as protocols to support file.
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”
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.
CSC 600 Internetworking with TCP/IP Unit 5: IP, IP Routing, and ICMP (ch. 7, ch. 8, ch. 9, ch. 10) Dr. Cheer-Sun Yang Spring 2001.
1 Transport Protocols Relates to Lab 5. An overview of the transport protocols of the TCP/IP protocol suite. Also, a short discussion of UDP.
Telecommunications Essentials John R. Durrett July 5, 2005.
1 CSE 5346 Spring Network Simulator Project.
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 Kyung Hee University Chapter 11 User Datagram Protocol.
TCP/IP PROTOCOL UNIT 6. Overview of TCP/IP Application FTP, Telnet, SMTP, HTTP.. Presentation Session TransportHost-to-HostTCP, UDP NetworkInternetIP,
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.
Process-to-Process Delivery:
4: Network Layer4-1 Chapter 4: Network Layer r 4. 1 Introduction r 4.2 Virtual circuit and datagram networks r 4.3 What’s inside a router r 4.4 IP: Internet.
Introduction To TCP/IP Networking Mr. Zeeshan Ali, Asst. Professor
Introduction to TCP/IP networking
Transport Protocols Relates to Lab 5. An overview of the transport protocols of the TCP/IP protocol suite. Also, a short discussion of UDP.
Transport Layer.
TCP Transport layer Er. Vikram Dhiman LPU.
Internet Control Message Protocol (ICMP)
Transport Protocols Relates to Lab 5. An overview of the transport protocols of the TCP/IP protocol suite. Also, a short discussion of UDP.
Transport Protocols Relates to Lab 5. An overview of the transport protocols of the TCP/IP protocol suite. Also, a short discussion of UDP.
Transport Protocols Relates to Lab 5. An overview of the transport protocols of the TCP/IP protocol suite. Also, a short discussion of UDP.
Transport Protocols An overview of the transport protocols of the TCP/IP protocol suite. Also, a short discussion of UDP.
Net 323 D: Networks Protocols
PART 5 Transport Layer.
Networks and Protocols
32 bit destination IP address
Transport Protocols Relates to Lab 5. An overview of the transport protocols of the TCP/IP protocol suite. Also, a short discussion of UDP.
Transport Layer 9/22/2019.
Presentation transcript:

Packet Analysis with Wireshark ARP, IP, TCP, UDP, ICMP Kyu Hyun Choi

Wireshark? Free and open-source network packet analyzer for Unix, Linux, Windows, OSX, BSD, Solaris and so on https://www.wireshark.org/

What can we do with Wireshark Network troubleshooting, analysis Software and communications protocol development Education Hacking !

Getting Started Download and install wireshark

Select Device

Start live capture Captured Network Packet list Analyzed information about the packet Packet Raw data

ARP Address Resolution Protocol Telecommunication protocol used for resolution of network layer addresses into link layer addresses Convert IP address to a physical address (such as MAC address)

ARP – Packet structure The length of the address fields is determined by the corresponding address length fields

ARP – Packet structure Hardware type (HTYPE) Protocol type (PTYPE) Specifies the network protocol type. e.g. Ethernet = 1 Protocol type (PTYPE) Specifies the internet protocol for which the ARP request is intended. For IPv4, this has the value 0x0800 Hardware address length (HLEN) Length of a hardware address. Ethernet addresses size is 6. Protocol address length (PLEN) Length of addresses used in the upper layer protocol (Specified in PTYPE). IPv4 address size is 4.

ARP – Packet structure Operation code Sender hardware address (SHA) Specifies the operation that the sender is performing. 1 for request, 2 for reply Sender hardware address (SHA) ARP Request → Indicate the address of the host sending the request ARP reply → Indicate the address of the host that the request was looking for Sender protocol address (SPA) Internetwork address of the sender Target hardware address (THA) ARP Request → Ignored ARP Reply → Indicate the address of the host that originated the ARP request Target protocol address (TPA) Internetwork address of the intended receiver

IP Internet Protocol Unique global address for a network interface An IP address: is a 32 bit long identifier (IPv4) encodes a network number and a host number

Network prefix and host number The network prefix identifies a network The host number identifies a specific host How do we know how long the network prefix is? The network prefix is indicated by a netmask e.g. 255.255.255.0 → Network prefix is first 3 bytes, and last byte is host number Notation: 163.152.73.70/24 Network prefix is 24 bits long network prefix host number

IP datagram format

32 bit destination IP address IP header fields IP protocol version number 32 bits total datagram length (bytes) header length (bytes) head. len type of service ver length “type” of data fragment offset 16-bit identifier for fragmentation / reassembly flags max number remaining hops (decremented at each router) time to live upper layer header checksum upper layer protocol to deliver payload to Checksum. Protect the header of IP data packets against data corruption 32 bit source IP address 32 bit destination IP address Options (if any) E.g. timestamp, record route taken, specify list of routers to visit. Data (typically a TCP or UDP segment)

IP header Analysis with Wireshark IP is in Network Layer So IP packets are padded by lower layer protocols First 12 Bytes are Ethernet header Source and destination MAC address

IP header Analysis with Wireshark IPv4 header fields 20bytes 0x45 = 0100 0101 0100 = 4 (Version: 4) 0101 = 5 (5 × 4B (1 word) = 20B) 0x00 = 0000 0000 Type of service Nothing special

IP header Analysis with Wireshark 0x05dc = 1500 Total length 0xf146 = 61766 Identification 0x40 = 010 0 0000 010: Bit vector (Reserved bit)(Don’t fragment)(More fragment) 00000: fragment offset 0x2e = 46 Time To Live

IP header Analysis with Wireshark 0x06 = 6 (TCP) Upper layer protocol is TCP 0xcdb9 Checksum 0x3a7860c5: 58.120.96.197 Source IP 0xa3984946: 163.152.73.70 Destination IP

IP Checksum calculation Divide IP header field into 2 bytes segment Assume that checksum bytes are 0x0000 Add all byte segments The sum is 0x00 03 32 43 in this case Add the carries to lower 2 bytes of the sum 0x0003 + 0x3243 = 0x3246 Take 1’s complement 0x3246 = 0011 0010 0100 0110 → 1100 1101 1011 1001 = 0xcdb9 Profit!!!

Transport Layer Protocols TCP – Transmission Control Protocol Stream oriented Reliable, connection-oriented Complex Only unicast Used for most internet applications: Web (http), email (smtp), file transfer (ftp), terminal (telnet), etc. UDP – User Datagram Protocol Datagram oriented Unreliable, connectionless Simple Unicast and multicast Useful only for few applications e.g. Multimedia applications Used a lot for services Network management (SNMP), routing (RIP), naming (DNS), etc.

TCP Transmission Control Protocol TCP is a connection-oriented protocol It creates a virtual connection between two TCPs to send data Uses flow and error control mechanism at the transport layer Provides a reliable unicast end-to-end byte stream over an unreliable internetwork

TCP header format

TCP header fields Port Number: A port number identifies the endpoint of a connection (process) A pair <IP address, port number> identifies one endpoint of a connection

TCP header fields Sequence Number (Seq) Sequence number is 32 bits long So the range of sequence number is 0 ≤ seq ≤ 232 -1 Each sequence number identifies a byte in the byte stream Initial Sequence Number (ISN) of a connection is set during connection establishment

TCP header fields Acknowledgement Number (Ack): Acknowledgements are piggybacked, i.e. A segment from A → B can contain an acknowledgement for a data sent in the B → A direction A host uses the Ack field to send acknowledgements If a host sends an Ack in a segment it sets the “ACK flag” The Ack contains the next Seq that a hosts wants to receive e.g. The acknowledgement for a segment with Seq 0-1500 is Ack=1501

TCP header fields - Flags

TCP header fields Window Size: TCP checksum: Urgent Pointer: Each side of the connection advertises the window size Window size is the maximum number of bytes that a receiver can accept Maximum window size is 216 – 1 = 65535 bytes TCP checksum: TCP checksum covers over both TCP header and TCP data Urgent Pointer: Only valid if URG flag is set

TCP header analysis with Wireshark

TCP header analysis with Wireshark 0x0050 = 80 Source port 0x1f53 = 8019 Destination port

TCP header analysis with Wireshark 0xbe7c79b6 Sequence number 0xf4b7bd42 Ack number 0x5 = 5 Header length 5 × 4byte (1word) = 20bytes

TCP header analysis with Wireshark 0x010 Flags Bit vector Acknowledgment 0x0036 Window size 0x26fb Checksum 0x0000 Urgent pointer

UDP User Datagram Protocol Connectionless, unreliable transport protocol UDP merely extends the host-to-host delivery serivce of IP datagram to an process-to-process service The only thing that UDP adds is multiplexing and demultiplexing

UDP format

UDP header fields Port numbers identify sending and receiving processes Total length is at least 8 bytes (i.e., Data field can be empty) and at most 65,535 Checksum is for header of UDP and some of the IP header fields (Pseudoheader)

Checksum Calculation

Checksum Calculatioin

UDP header analysis with Wireshark Ethernet header and IPv4 header is padded before UDP header 0xc93f Source port: 51519 0x079b Destination port: 1947 0x0030 Length: 48B (header + data) 0xdb48 Checksum

ICMP Internet Control Message Protocol 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 Internet Control Message Protocol 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 datagrams

ICMP Format 4 byte header Type (1byte): type of ICMP message Code (1byte): subtype of ICMP message Checksum (2bytes): similar to IP header checksum. Caculated over entire ICMP message If there is no additional data, there are 4 bytes set to zero Each ICMP messages is at least 8 bytes long

ICMP in TCP/IP Special purpose message mechanism added to the TCP/IP protocols ICMP is a network layer protocol, but its messages are first encapsulated into IP datagram

ICMP header analysis with Wireshark

ICMP header analysis with Wireshark 0x08 Type: 8 0x00 Code: 0 Echo (ping) request 0x4d53 Checksum 0x0001 0008 Additional information Identifier in this case Wireshark shows it into two types Big endian, Little endian Rest bits are data