CDPA 網管訓練 駭客任務 2 Ethernet Switching ARP, IP, LAN, Subnet IP Header, Routing ICMP 2006.03.23.

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

Computer Networks20-1 Chapter 20. Network Layer: Internet Protocol 20.1 Internetworking 20.2 IPv IPv6.
4 IP Address (IPv4)  A unique 32-bit number  Identifies an interface (on a host, on a router, …)  Represented in dotted-quad notation
Network Layer – IPv4 Dr. Sanjay P. Ahuja, Ph.D.
TCP/IP TCP/IP architecture
21.1 Chapter 21 Network Layer: Address Mapping, Error Reporting, and Multicasting Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction.
Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 5-1 Internet Protocol (IP): Packet Format, Fragmentation, Options Shivkumar Kalyanaraman Rensselaer.
Network Layer Packet Forwarding IS250 Spring 2010
CSCE 515: Computer Network Programming Chin-Tser Huang University of South Carolina.
IP Suite© Dr. Ayman Abdel-Hamid, CS4254 Spring CS4254 Computer Network Architecture and Programming Dr. Ayman A. Abdel-Hamid Computer Science Department.
The Network Layer Chapter 5. The IP Protocol The IPv4 (Internet Protocol) header.
Internet Control Message Protocol (ICMP). Introduction The Internet Protocol (IP) is used for host-to-host datagram service in a system of interconnected.
Chapter 5 The Network Layer.
11- IP Network Layer4-1. Network Layer4-2 The Internet Network layer forwarding table Host, router network layer functions: Routing protocols path selection.
IP Protocol. The Internet Protocol (IP) is a network-layer (Layer 3) protocol that contains addressing information and some control information that enables.
1 Application TCPUDP IPICMPARPRARP Physical network Application TCP/IP Protocol Suite.
Oct 19, 2004CS573: Network Protocols and Standards1 IP: Datagram and Addressing Network Protocols and Standards Autumn
Lecture 20: Network Primer 7/8/2003 CSCE 590 Summer 2003.
Connecting Networks © 2004 Cisco Systems, Inc. All rights reserved. Defining the IP Packet Delivery Process INTRO v2.0—4-1.
TELE202 Lecture 10 Internet Protocols (2) 1 Lecturer Dr Z. Huang Overview ¥Last Lecture »Internet Protocols (1) »Source: chapter 15 ¥This Lecture »Internet.
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.
ICMP (Internet Control Message Protocol) Computer Networks By: Saeedeh Zahmatkesh spring.
© Janice Regan, CMPT 128, CMPT 371 Data Communications and Networking Network Layer ICMP and fragmentation.
Internet Protocol (IP)
IP (Internet Protocol) –the network level protocol in the Internet. –Philosophy – minimum functionality in IP, smartness at the end system. –What does.
IP tutorial – #1 KAIST Dept. of CS NC Lab..
The Network Layer. Network Projects Must utilize sockets programming –Client and Server –Any platform Please submit one page proposal Can work individually.
1 ECE453 – Introduction to Computer Networks Lecture 12 – Network Layer (IV)
TCOM 509 – Internet Protocols (TCP/IP) Lecture 03_a
Herramientas para diagnósticos. Ping USO: Ping nombre.dominio o dirección IP Options: -t Ping the specifed host until interrupted. -a Resolve addresses.
TCOM 515 IP Routing Lab Lecture 1. Class information Instructor: Wei Wu –Lecture and Lab session 2 – Instructor:
1 Internet Protocol. 2 Connectionless Network Layers Destination, source, hop count Maybe other stuff –fragmentation –options (e.g., source routing) –error.
IP Forwarding.
1 IP: putting it all together Part 1 G53ACC Chris Greenhalgh.
10/13/2015© 2008 Raymond P. Jefferis IIILect 07 1 Internet Protocol.
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.
Microsoft Windows Server 2003 TCP/IP Protocols and Services Technical Reference Slide: 1 Lesson 5 Internet Protocol (IP) Basics.
Suez Canal University – Faculty of Computers & Informatics - Cisco Local Academy Network Fundamentals.
TCOM 515 IP Routing. Syllabus Objectives IP header IP addresses, classes and subnetting Routing tables Routing decisions Directly connected routes Static.
1 IP : Internet Protocol Computer Network System Sirak Kaewjamnong.
Review the key networking concepts –TCP/IP reference model –Ethernet –Switched Ethernet –IP, ARP –TCP –DNS.
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.
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.
Communications Services Connection Oriented Service  A connection is established  Data is sent or received over this connection  Connection may be terminated.
Internet Protocol Formats. IP (V4) Packet byte 0 byte1 byte 2 byte 3 data... – up to 65 K including heading info Version IHL Serv. Type Total Length Identifcation.
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.
TCP/IP Illustracted Vol1. 제목 : IP Routing ( 수 ) 한 민 규
Linux Operations and Administration Chapter Eight Network Communications.
1 Computer Communication & Networks Lecture 19 Network Layer: IP and Address Mapping Waleed Ejaz.
Net7: IP 協定 Internet Protocol 授課教師:雲林科技大學 張慶龍 老師.
Lecture 21: Network Primer 7/9/2003 CSCE 590 Summer 2003.
IP Internet Protocol. IP TCP UDP ICMPIGMP ARP PPP Ethernet.
Packet Switch Network Server client IP Ether IPTCPData.
IP - Internet Protocol No. 1  Seattle Pacific University IP: The Internet Protocol Kevin Bolding Electrical Engineering Seattle Pacific University.
Lecture 13 IP V4 & IP V6. Figure Protocols at network layer.
© 2003, Cisco Systems, Inc. All rights reserved.
Dr. Richard Spillman Fall 2006
Network Layer Protocols
CS 457 – Lecture 10 Internetworking and IP
Internet Control Message Protocol (ICMP)
Internet Protocol (IP)
Advanced Computer Networks
IP : Internet Protocol Surasak Sanguanpong
Internetworking Outline Best Effort Service Model
Wide Area Networks and Internet CT1403
Advanced Computer Networks
Anjuman College of Engineering and Technology Department of Computer Science and Engineering VII Sem. TCP and IP (Elective I) Prof. Nazish Khan.
32 bit destination IP address
Presentation transcript:

CDPA 網管訓練 駭客任務 2 Ethernet Switching ARP, IP, LAN, Subnet IP Header, Routing ICMP

今日目標 複習 & 補充 Ethernet Switching Ethernet Switching ARP ARP了解 IP Header IP Header Gateway (Routing) Gateway (Routing) Subnet Subnet ICMP Echo ICMP Echo工具 Nemesis Nemesis Tcpdump Tcpdump

Ethernet switching Ethernet HUB

Ethernet Switching Switch 123 A B C12 3 A -> C

Ethernet Switching Switch 123 A B C1A2 3C C -> A

Ethernet Switching Switch 123 A B C1A2 3C A -> C

ARP 00:00:00:00:00:0100:00:00:00:00: I want to communicate with Who has tell (00:00:00:00:00:01)

ARP 00:00:00:00:00:0100:00:00:00:00: I (00:00:00:00:00:02) have to (00:00:00:00:00:01)

Let’s try~~ 2 people a group Try to use computer A ping computer B. Try to use computer A ping computer B. Use computer C and the other two to listen. Use computer C and the other two to listen. Tool: tcpdump sudo tcpdump –I eth0 icmp or arp sudo tcpdump –I eth0 icmp or arp

IP Header

Version IPv4 -> value 4 IPv4 -> value 4 Internet Header Length (IHL) Internet Header Length (IHL) 4-bit Internet Header Length (IHL) telling the number of 32-bit words in the header. 4-bit Internet Header Length (IHL) telling the number of 32-bit words in the header. Value = Header Length (byte) / 4 Value = Header Length (byte) / 4

IP Header Type of Service In RFC 791, the following 8 bits were allocated to a Type of Service (ToS) field: In RFC 791, the following 8 bits were allocated to a Type of Service (ToS) field:RFC 791RFC 791 bits 0-2: precedence bit 3: 0 = Normal Delay, 1 = Low Delay bit 4: 0 = Normal Throughput, 1 = High Throughput bit 5: 0 = Normal Reliability, 1 = High Reliability bits 6-7: Reserved for future use

IP Header Total Length This field defines the entire datagram size, including header and data, in bytes. The minimum-length datagram is 20 bytes (20 bytes header + 0 bytes data) and the maximum is 65,535 — the maximum value of a 16-bit word. This field defines the entire datagram size, including header and data, in bytes. The minimum-length datagram is 20 bytes (20 bytes header + 0 bytes data) and the maximum is 65,535 — the maximum value of a 16-bit word.Identification Fragments of original datagram. Fragments of original datagram.

IP Header Flags (3 bits) Reserved, must be zero Reserved, must be zero Don't Fragment (DF) Don't Fragment (DF) More Fragments (MF) More Fragments (MF) Fragment Offset The offset of data from original datagram. The offset of data from original datagram. Time To Live (TTL) Time To Live (TTL) The maxim hop (router) datagram travels. The maxim hop (router) datagram travels.

IP Header Protocol TCP TCP UDP UDP ICMP ICMP Header Checksum Source, Destination Address Options

Subnet, netmask, CIDR CIDR Classless Inter-Domain Routing Classless Inter-Domain RoutingNetmask The continues bit length from most significant bit to least significant bit. The continues bit length from most significant bit to least significant bit. Used to determine the network id (LAN size). Used to determine the network id (LAN size).

subnet example IP Mask IP: IP: MASK: MASK: Network ID: Network ID: Host ID: Host ID: Same Meaning: /24 Same Meaning: /24 Same network ID: LAN LAN No need router. No need router.

Router When do we need router? Destination IP is not in LAN. Destination IP is not in LAN. ((Local IP) & (Netmask)) != ((Dst IP) & (Netmask)) Why do we need router? Destination host is not in LAN, can’t access it by Layer 2(Datalink Layer, MAC Address). Destination host is not in LAN, can’t access it by Layer 2(Datalink Layer, MAC Address). How do we use router? Simply use router’s MAC Address as Frame’s Destination MAC Address. Simply use router’s MAC Address as Frame’s Destination MAC Address.

Router How does router work? Use Destination IP Address to decide where the packet should go. Use Destination IP Address to decide where the packet should go.

Let’s try it~~~ Routing table netstat –rn netstat –rn Become a router sudo sysctl net.ipv4.conf.all.forwarding=1 sudo sysctl net.ipv4.conf.all.forwarding=1 Add new IP to interface sudo ifconfig eth0 inet add xxx.xxx.xxx.xxx netmask xxx.xxx.xxx.xxx sudo ifconfig eth0 inet add xxx.xxx.xxx.xxx netmask xxx.xxx.xxx.xxx Modify the interface IP sudo ifconfig eth0 inet xxx.xxx.xxx.xxx netmask xxx.xxx.xxx.xxx sudo ifconfig eth0 inet xxx.xxx.xxx.xxx netmask xxx.xxx.xxx.xxx Add a default gateway sudo route add default gw xxx.xxx.xxx.xxx sudo route add default gw xxx.xxx.xxx.xxx

ICMP Echo {request, reply} Type and Code must be set to 0. The Identifier and Sequence Number can be used by the client to manage which Echo Requests are associated with the Echo Replies. The Data received by the Echo Request must be entirely included in the Echo Reply.

Final exercise Use nemesis to send ICMP Echo Request To LAN To LAN To WAN To WAN Must use following args: Must use following args: -d –H –M, –S –D, -i -c -s -e Use tcpdump to listen ICMP Echo Reply. sudo tcpdump –i eth0 icmp sudo tcpdump –i eth0 icmp

Thanks for listening Any Question??