Networking Fundamentals

Similar documents
TCP/IP Network Essentials

IP Basics Unix/IP Preparation Course June 29, 2010 Pago Pago, American Samoa

IPv4 exhaustion and Implications

The Internet Protocol (IP)

TCP/IP and the OSI Model

Chapter 5 Network Layer

Chapter 2 - Part 1. The TCP/IP Protocol: The Language of the Internet

Chapter 7. Local Area Network Communications Protocols

Agenda L2 versus L3 Switching IP Protocol, IP Addressing IP Forwarding ARP and ICMP IP Routing First Hop Redundancy

TCP/IP Protocol Suite and IP Addressing

Copyleft 2005, Binnur Kurt. Objectives

OSI Data Link & Network Layer

Lecture 1: Introduction

Data Communication Prof. A. Pal Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur Lecture 34 TCP/ IP I

TCP /IP Fundamentals Mr. Cantu

The Interconnection Structure of. The Internet. EECC694 - Shaaban

Defining Networks with the OSI Model. Module 2

EITF25 Internet Techniques and Applications L7: Internet. Stefan Höst

TCP/IP Networking. Training Details. About Training. About Training. What You'll Learn. Training Time : 9 Hours. Capacity : 12

TSIN02 - Internetworking

IP Protocols. ALTTC/Oct

Vorlesung Kommunikationsnetze

OSI Data Link & Network Layer

IP - The Internet Protocol. Based on the slides of Dr. Jorg Liebeherr, University of Virginia

OSI Data Link & Network Layer

CSCI-1680 Network Layer: IP & Forwarding Rodrigo Fonseca

Guide to Networking Essentials, 6 th Edition. Chapter 5: Network Protocols

Addressing and Routing

The Internet Protocol. IP Addresses Address Resolution Protocol: IP datagram format and forwarding: IP fragmentation and reassembly

Communication Networks ( ) / Fall 2013 The Blavatnik School of Computer Science, Tel-Aviv University. Allon Wagner

Introduction to Computer Networks. CS 166: Introduction to Computer Systems Security

TCP/IP THE TCP/IP ARCHITECTURE

OSI Reference Model. Computer Networks lab ECOM Prepared By : Eng. Motaz Murtaja Eng. Ola Abd Elatief

Data and Computer Communications. Chapter 2 Protocol Architecture, TCP/IP, and Internet-Based Applications

IP: (Internet Protocol) IP - 1

Internet Protocol, Version 6

Interconnecting Networks with TCP/IP

The Network Layer. Internet solutions. Nixu Oy PL 21. (Mäkelänkatu 91) Helsinki, Finland. tel fax.

06/02/ Local & Metropolitan Area Networks 0. INTRODUCTION. 1. History and Future of TCP/IP ACOE322

cs144 Midterm Review Fall 2010

ROUTING INTRODUCTION TO IP, IP ROUTING PROTOCOLS AND PROXY ARP

Computer Networking: A Top Down Approach Featuring the. Computer Networks with Internet Technology, William

Internet. Organization Addresses TCP/IP Protocol stack Forwarding. 1. Use of a globally unique address space based on Internet Addresses

ARP, IP. Chong-Kwon Kim. Each station (or network interface) should be uniquely identified Use 6 byte long address

Examination 2D1392 Protocols and Principles of the Internet 2G1305 Internetworking 2G1507 Kommunikationssystem, fk SOLUTIONS

Interconnecting Networks with TCP/IP. 2000, Cisco Systems, Inc. 8-1

ET4254 Communications and Networking 1

Networking for Data Acquisition Systems. Fabrice Le Goff - 14/02/ ISOTDAQ

Solved MCQ of Computer networking. Set-1

Chapter 5 TCP/IP SUITE

Review of Important Networking Concepts

This tutorial will help you in understanding IPv4 and its associated terminologies along with appropriate references and examples.

01/17/08 TDC /17/08 TDC363-03

Imi :... Data:... Nazwisko:... Stron:...

Chapter 4 Network Layer

Network Protocols - Revision

Fundamentals of Computer Networking AE6382

5105: BHARATHIDASAN ENGINEERING COLLEGE NATTARMPALLI UNIT I FUNDAMENTALS AND LINK LAYER PART A

Hands-On TCP/IP Networking

( A ) 1. WAP is a (A) protocol (B) hardware (C) software (D) network architecture

IP - The Internet Protocol

Aeronautical Systems Center

Network Access Layer Internet Layer Transport Layer Application Layer. Presentation. Transport. Physical

Define TCP/IP and describe its advantages on Windows Describe how the TCP/IP protocol suite maps to a four-layer model

Guide to TCP/IP, Third Edition. Chapter 3: Data Link and Network Layer TCP/IP Protocols

Networks. an overview. dr. C. P. J. Koymans. Informatics Institute University of Amsterdam. February 4, 2008

Applied Networks & Security

Network Security Fundamentals. Network Security Fundamentals. Roadmap. Security Training Course. Module 2 Network Fundamentals

Computer Networks. Lecture 9 Network and transport layers, IP, TCP, UDP protocols

Networking Models OSI Model Created by International Organization Standardization

CCNA MCQS with Answers Set-1

FINAL EXAM REVIEW PLEASE NOTE THE MATERIAL FROM LECTURE #16 at the end. Exam 1 Review Material

Novell TCP IP for Networking Professionals.

Dongsoo S. Kim Electrical and Computer Engineering Indiana U. Purdue U. Indianapolis

/

Internetworking/Internetteknik, Examination 2G1305 Date: August 18 th 2004 at 9:00 13:00 SOLUTIONS

Objectives. Chapter 10. Upon completion you will be able to:

McGraw-Hill The McGraw-Hill Companies, Inc., 2000

The Network Layer. Internet solutions. Nixu Oy PL 21. (Mäkelänkatu 91) Helsinki, Finland. tel fax.

OSI Network Layer. Network Fundamentals Chapter 5. Version Cisco Systems, Inc. All rights reserved. Cisco Public 1

CPEG514 Advanced Computer Networks. Atef Abu Salim University of Nizwa Spring 2013/2014

CPSC 826 Internetworking. The Network Layer: Routing & Addressing Outline. The Network Layer

Chapter 18 and 22. IPv4 Address. Data Communications and Networking

CSCI-1680 Network Layer: IP & Forwarding John Jannotti

Fundamentals of Networking. OSI & TCP/IP Model. Kuldeep Sonar 1

Introduction to TCP/IP

Just enough TCP/IP. Protocol Overview. Connection Types in TCP/IP. Control Mechanisms. Borrowed from my ITS475/575 class the ITL

CCNA Exploration Network Fundamentals. Chapter 04 OSI Transport Layer

IT220 Network Standards & Protocols. Unit 8: Chapter 8 The Internet Protocol (IP)

Lab Using Wireshark to Examine Ethernet Frames

Significance of TCP/IP Model Divya Shree Assistant Professor (Resource Person), Department of computer science and engineering, UIET, MDU, Rohtak

The Internet. The Internet is an interconnected collection of netw orks.

Network Reference Models

Acknowledgments. Part One - Introduction to the TCP/IP Protocol

Concept Questions Demonstrate your knowledge of these concepts by answering the following questions in the space that is provided.

RMIT University. Data Communication and Net-Centric Computing COSC 1111/2061. Lecture 2. Internetworking IPv4, IPv6

Domain 1.0 Network Technologies

Communicating over the Network

ECPE / COMP 177 Fall Some slides from Kurose and Ross, Computer Networking, 5 th Edition

Introduction to TCP/IP networking

Transcription:

Networking Fundamentals Network Startup Resource Center www.nsrc.org These materials are licensed under the Creative Commons Attribution-NonCommercial 4.0 International license (http://creativecommons.org/licenses/by-nc/4.0/)

Objectives Introduce Core Concepts & Terminology Layers & Layer Models Encapsulation Frames, Datagrams, Segments, Packets TCP/IP Protocol Suite IP Addressing IP Routing Basic Linux Network Commands

Layers Internet functions can be divided in layers Easy to understand Easy to program for Change one layer without changing other layers Easy to write standards for and test Two main models of layers are used: OSI (Open Systems Interconnection) Layers TCP/IP Layers We'll cover both models in detail

Layers & Encapsulation Each layer provides services to the layer above Each layer makes use of the layer below Data from one higher layers is encapsulated in frames of the layer below

Encapsulation & Decapsulation Lower layers add headers (& trailers) to upper layer packets Application Data Transport Header Header Data Transport Packet Network Header Header Header Data Network Packet Trailer Data Link Header Header Header Data Trailer

Encapsulation in Action L2 header L3 header L4 header Application Data L4 segment contains part of stream of application protocol L3 datagram contains L4 segment L2 frame has L3 datagram in data portion

Frame, Datagram, Segment, Packet Different names for packets at different layers Link Layer = Ethernet Frame Network Layer = IP Packet Transport Layer = TCP Segment Terminology is not strictly followed We often just use the term packet at any layer

OSI Seven Layer Model Conceptual model developed by the International Organization for Standardization (ISO) in 1984 Layer 7 Application (servers & clients, web browsers, httpd) Layer 6 Presentation (file formats, e.g. PDF, ASCII, JPEG) Layer 5 Session (conversation initialization, termination) Layer 4 Transport (inter host comm error correction) Layer 3 Network (routing path determination, IP addresses) Layer 2 Data link (switching media access, MAC addresses) Layer 1 Physical (signaling representation of binary digits)

OSI Model

Layer 1: Physical Layer Transfers a stream of bits Defines physical characteristics Connectors, pinouts Cable types, voltages, modulation Fibre types, lambdas Transmission rate (bits per second) No knowledge of bytes or frames

Layer 1: Physical Layer By Peretuset (Own work) CC BY 3.0 (http://creativecommons.org/licenses/by/3.0)], via Wikimedia Commons

Layer 1: Physical Layer Types of Equipment Hub Repeater Media Converter Works at the level of individual bits All data sent out of all ports Data may go where it is not needed

Building Networks at Layer 1 Repeater Repeater Hub Hub Hub

Layer 2: Data Link Layer Organizes data into frames May detect transmission errors (corrupt frames) May support shared media Access control, collision detection Carrier Sense, Multiple Access, Collision Detect Addressing (who should receive the frame) Unicast, Multicast Usually identifies the L3 protocol carried

Layer 2 Example: SLIP 0xC0 Data Flag 0xDB or 0xDC or 0xDD That's it!

Layer 2 Example: PPP Flag Protocol Data FCS Also includes link setup and negotiation Agree link parameters (LCP) Authentication (PAP/CHAP) Layer 3 Settings (IPCP) Flag

Layer 2 Example: Ethernet Preamble Mac Dest Mac Src Proto MAC addresses Protocol: 2 bytes Data FCS e.g. 0800 = IPv4, 0806 = ARP, 86DD = IPv6 Preamble: Carrier Sense, Collision Detection

Layer 2: Data Link Layer Types of Equipment Switch Bridge Receives L2 frames & selectively retransmits Learns which MAC addresses on which ports MAC known: only sends traffic to correct port MAC unknown: broadcast to all ports (like hub) Doesn't inspect packet beyond L2 header

Building Networks at Layer 2 Switch Switch Switch

Layer 3: Network Layer Connects Layer 2 networks together Forwards data from one network to another Universal frame format (datagram) Unified addressing scheme Independent of underlying L2 networks Globally organized and managed addresses Identifies the Layer 4 protocol being carried Handles fragmentation and reassembly of packets

Layer 3 Example: IPv4 Datagram Version, Length Flags, Fragments TTL Protocol Header Checksum Src Addr Dest Addr Data Source, Destination: IPv4 addresses Protocol: 1 byte e.g. 6 = TCP, 17 = UDP see /etc/protocols

Layer 3: Network Layer Types of Equipment Router Layer 3 Switch Router Routers managed together are an Autonomous System Routers look at Destination IP in Forwarding Table Forwarding table can be static or dynamic Static is built by hand, or scripted externally Dynamic within an AS: Interior Gateway Protocol (IGP) Dynamic between AS: Exterior Gateway Protocol (EGP)

Building Networks At Layer 3 Router Broadcast Domain Switch Switch Collision Domain Hub Hub Switch Switch

Layer 4: Transport Layer Identifies the endpoint process Another level of addressing (port numbers) May provide reliable delivery Streams of unlimited size Error correction & retransmission In-sequence delivery Flow control Might just be unreliable datagram transport

Layer 4: User Datagram Protocol Src Port Dest Port Length CHK Data System (Well-Known) Ports < 1024 53, 69, 161, 162 User (Registered) Ports 1024-49151 Dynamic (Ephemeral) Ports IANA Recommends 49152, Linux uses 32768 Typically used for temporary, one session only Other end of a conversation with a well-known port

Layers 5+6: Session & Presentation Session Layer: long-lived sessions Re-establish transport connection if it fails Multiplex data across multiple connections Presentation Layer: data reformatting Character set translation Neither exist in the TCP/IP suite Application is responsible for these functions

Layer 7: Application Layer The actual work you want to do Protocols specific to each application Examples?

OSI Model

Other Layer Models The OSI Model is most used... but The DoD Model also applicable... and The Hourglass Model is realistic & appropriate

DoD Four-Layer Model Application Layer Presentation SMTP HTTP FTP SMTP Telnet DNS BootP DHCP (MIME) Routing Protocols Session Transport Layer Internet Layer Network Interface Layer etc. TCP UDP Transmission Control Protocol User Datagram Protocol OSPF BGP RIP E G P IP Internet Protocol ICMP IP Transmission over ATM RFC 1483 IEEE 802.2 RFC 1042 X.25 RFC 1356 ARP FR RFC 1490 RARP PPP RFC 1661

OSI vs DoD Layer Models OSI Model TCP / IP Application Presentation User Space Application Session Softwar e Transport Transport Network Internet Har dwar e Data Link Network Interface Physical Firmwar e Operating System

TCP/IP Hourglass Model Mail Client WebR TC SMTP Web Browser HTTP TCP UDP 802.1 1 (WiFi) ICMP(v6) IPv6 Ethernet Fibre Ping RTP IPv4 Air VoIP Client PPP Copper Pigeons

Layers Summary Networks designed & described with layers OSI Model: 7 Layers DoD: 3-5 Layer Model Hourglass Model: 6 Layers Each layer encapsulates the layer below Receiving hosts reverse the process

IP Addresses for IPv4 32 bit addresses Calculating in decimal, bin and hex Hierarchical division in IP Addresses Network Masks Allocating Addresses Special IP addresses Subnetting / Supernetting

What's an IPv4 Address? 32 bit number 4 octet number Can be represented in several ways:

Calculating dec, hex, bin ipcalc is your friend! Try this: ipcalc 133.27.162.125 The Linux command line is your friend! Try this: echo 'ibase=10;obase=16;27' bc echo 'ibase=10;obase=2;27' bc echo 'ibase=16;obase=a;1b' bc

Hierarchical Division in IP Addresses Network Part (Prefix): Describes which network Host Part (Host Address): Describes which host Boundary can be anywhere! Used to be a multiple of 8, but not required today 205 154 8 1 1 1 0 0 1 1 0 1 1 0 0 1 1 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 Network Mask Host

Network Masks Help define which bits are used for the Network And which bits are used for the hosts Different Representations Exist: Decimal dot notation Binary notation Number of network bits Binary AND of 32 bit IP address with 32 bit netmask = network part of address

Sample Netmasks (netmask 255.255.128.0) 137.158.128.0/17 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 137 158 128 0 1 0 0 1 1 0 0 1 1 0 0 1 1 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 (netmask 255.255.0.0) 198.134.0.0/16 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 198 134 0 0 1 1 0 0 0 1 1 0 1 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 (netmask 255.255.255.192) 205.37.193.128/26 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 205 37 193 128 1 1 0 0 1 1 0 1 0 0 1 0 0 1 0 1 1 1 0 0 0 0 0 1 1 0 0 0 0 0 0 0

Allocating IP addresses The subnet mask defines the network size A mask of /24 or 255.255.255.0 32-24 = 8 host bits 2^8 2 = 254 possible hosts A mask of /27 or 255.255.255.224 32 27 = 5 host bits 2^5 2 = 30 possible hosts

Special IP Addresses Network Address: All 0s in the host part e.g. 193.0.0.0/24 e.g. 138.37.128.0/17 Broadcast Address: All 1s in the host part e.g. 137.156.255.255 e.g. 134.132.100.255 Loopback Address 127.0.0.0/8 Special Addresses: 0.0.0.0 e.g. DHCP

Networks: Subnetting /27 /26 /27 Add one bit to the netmask & the network divides in two /25 /27 /26 This is subnetting /27 /24 /27 /26 /27 /25 /27 Example: 192.168.10.0/25 Subnets to: 192.168.10.0/26 192.168.10.64/26 /26 /27

Networks: Supernetting /26 Subtract one bit from netmask /25 & the network joins together /26 This is supernetting /24 192.168.10.0/26 /26 192.168.10.64/26 /25 /26 join together to form: 192.168.10.0/25

IP Numbers Public address space available from your NIC AFRINIC, APNIC, ARIN, LACNIC, RIPE NCC Private address space available to anyone RFC 1918 Ranges for private networks 10/8, 172.16/12, 192.168/16 RFC 6598 for large scale NAT 100.64.0.0/10

Routing Every host on the Internet needs a way to get packets to other hosts outside its own subnet Hosts that can move packets between subnets are called routers Packets can pass through many routers before reaching their destination

The Route Table All hosts (including routers) have a route table Route tables show which networks are connected They specify how to forward packets to other networks ip -B route on Linux to see v4 & v6 routes netstat -rn -46 on Linux see v4 & v6 routes netstat -rn on BSD/Mac to see v4 & v6 routes

IPv4 routing table entries Kernel IP routing table Destination Gateway 0.0.0.0 192.168.2.1 192.168.2.0 0.0.0.0 root@librenms:~# Genmask 0.0.0.0 255.255.255.0 Flags UG U MSS Window 0 0 0 0 irtt Iface 0 eth0 0 eth0 Destination is a network address Gateway is a router that can forward packets Iface is the network interface the route will use

The default route Kernel IP routing table Destination Gateway 0.0.0.0 192.168.2.1 192.168.2.0 0.0.0.0 root@librenms:~# Genmask 0.0.0.0 255.255.255.0 Flags UG U MSS Window 0 0 0 0 irtt Iface 0 eth0 0 eth0 Note the first entry in this route table It matches every possible IP address This is the default route It must be a router capable of forwarding traffic

More Complex Routing A router's route table could look like this Note multiple interfaces & multiple networks There's also a gateway for other networks Destination 192.168.0.0 192.168.1.0 192.168.2.0 192.168.4.0 0.0.0.0 Gateway 0.0.0.0 0.0.0.0 0.0.0.0 0.0.0.0 192.168.1.1 Genmask 255.255.255.0 255.255.255.0 255.255.254.0 255.255.252.0 0.0.0.0 Flags U U U U UG Interface eth0 eth1 eth2 eth3 eth0

Summary Layers & Layer Models Encapsulation Frames, Datagrams, Segments, Packets TCP/IP Protocol Suite IP Addressing IP Routing