Docsity

Computer Network Security: Protocol Analysis and Network Inter-connection, Lecture notes of Computer Networks

Partial preview of the text

Download Computer Network Security: Protocol Analysis and Network Inter-connection and more Lecture notes Computer Networks in PDF only on Docsity!

Network Protocol Analysis

Chun-Jen (James) Chung

Arizona State University

Protocol Analysis

• Purpose: to identify and analyze network problems.

• What are problems?

– Bad performance, unusual traffic/packets, malicious payload,

and potential vulnerabilities

• How do we solve it?

– Instrument the code :

• difficult task, network programming skills required.

– Use available tools: Ethereal, tcpdump/tshark, wireshark, etc.

– Write your own tool: libpcap

TCP/IP (4 layer model)

Network inter-connection

Ethernet driver

IP

driver

router

Web Client

Ethernet driver

IP

TCP

Web Server

Ethernet driver

IP

TCP

Ethernet

IP protocol

TCP protocol

HTTP protocol application

transport

network

link

Two networks connected with two routers

Ethernet protocol

driver

IP

Ethernet driver

router

Ethernet

Ethernet protocol

IP protocol

Serial connection

IP protocol

Serial protocols*

  • (Cisco support: EIA/TIA-232, EIA/TIA-449, V.35, X.21 and EIA-530 etc.)

WWW Request/Response Example

Client (^) Web Server (^) DNS

vm-server.my.com

Query Response A 172.24.55.

SYN, seq_num=x

SYN+ACK, seq_num=y, ack_num=x+

ACK, seq_num=x+1, ack_num=y+

HTTP Request (GET test.html)

ACK+HTTP Response (Not Modified)

FIN + ACK

ACK

DNS Query

3-way handshake to open a TCP connection

FIN + ACK (^) Terminating a TCP connection

Multiple request, single handshake

Wireshark System Overview

  • Capture all packets that

contain a host address of:

134.193.6.58 as either source

or destination

  • Capture packets for 20

seconds and then stop.

Sample Filters

• Capture Filter: (protocol)(direction)(hosts)(value)(logic op)(other)

– dst host 134.193.6.

– dst host 134.193.6.58 and dst port 12345

– src host 134.193.15.9 && dst net 216.92.131.

– host 134.193.6.58 and ip proto tcp

– dest host 134.193.6.58 && ip proto icmp

• Display Filter:

(protocol).(string1).(string2)(compare op)(value)(logic op)(other)

– dns || tcp

– ip.addr == 10.0.1.

– ip.src != 10.1.2.3 or ip.dst != 10.4.5.

– tcp.port == 22

– tcp.dstport == 25

– tcp.flags.syn == 0x

Well-known common ports

DNS Query Packet

TCP connection request

TCP connection response

Initial HTTP response

Status Line

Request

Headers

Blank line separates header and body Request Message body

  • The status code is a 3-digit number: 1xx (Informational), 2xx (Success), 3xx (Redirection),

4xx (Client Error), 5xx (Server Error).

  • 304 Not Modified: In response to the If-Modified-Since conditional GET request,

the server notifies that the resource requested has not been modified.

Client’s TCP SYN Packet

Client’s sequence number, c_sn=