450 likes | 458 Views
Chapter 3 Protocols. Protocols 3.1 Open Systems 3.2 The Layered Model 3.3 TCP/IP 3.4 IP Address 3.5 Subnetwork Classful network. Chapter 3 Protocol. Protocols. Protocol is a set of rules and procedures for communicating. When you travel to other countries, you should know
E N D
Chapter 3 Protocols Protocols 3.1 Open Systems 3.2 The Layered Model 3.3 TCP/IP 3.4 IP Address 3.5 Subnetwork Classful network
Chapter 3 Protocol Protocols • Protocol is a set of rules and procedures for communicating. • When you travel to other countries, you should know • the proper way to • meet • greet • communicate with the local people • When two computers communicate, they should • speak the same language • agree on the same rules of communication
Chapter 3 Protocol 3.1 Open Systems • An open system consists of • standardised rules, and • procedures • for manufacturers to follow in making their products. • standards are open to the public without cost • Manufacturers need not purchase license, but • their products have to conform with the standards
Chapter 3 Protocol 3.1.1 Proprietary Standards (1/3) • Proprietary standards products • developed by a vendor • no common agreement • regarded as trade secret • occurred in early stage of the computer industry
Chapter 3 Protocol 3.1.1 Proprietary Standards (2/3) • Bad implications of proprietary products: • Expensive • because supply is controlled by the vendor • Users familiar with one proprietary product cannot easily switch to other products • Communication and data sharing are hindered • the vendors use different protocols • cross platform compatibility • In networking, gateways are designed to solve this problem
Chapter 3 Protocol 3.1.1 Proprietary Standards (3/3) • Gateway • is the interface between two networks using different protocols • translating protocols from one standard to another • e.g. the broadband router in a home network
Chapter 3 Protocol 3.1.2 The needs for an Open System • Open systems: • created by people from academic and professional organisations • independent of vendors • standards are open to the public without cost • Manufacturers need not purchase license, but • their products have to conform with the standards
Chapter 3 Protocol 3.1.3 ISO and IEEE (1/2) • ISO (International Organisation for Standardisation) • voluntary organisation • has defined Open System Interconnection (OSI) • for networking model • several layers
Chapter 3 Protocol 3.1.3 ISO and IEEE (2/2) • IEEE (Institute of Electrical and Electronic Engineers) • professional organisation related to electricity • has specified IEEE 802 • Local Area Network (LAN) standards • year (1980) and month (February) • lower levels (hardware) of the OSI layered model
Chapter 3 Protocol 3.2 The Layered Model (1/4) • Layered model helps us to understand how a computer works. • Layered Model in Computer Systems
Chapter 3 Protocol 3.2 The Layered Model (2/4)
Chapter 3 Protocol 3.2 The Layered Model (3/4)
Chapter 3 Protocol 3.2 The Layered Model (4/4)
Chapter 3 Protocol 3.2 The Layered Model3.2.3 Data Flow in Layers • When a message is sent by a user, • it goes down through a stack of protocol layers. • information are added to the message by each layer • Then, • signals are produced by the NIC and transmitted over the cable. • On reaching the destination, • the message moves up the same stack of layers, • information previously added are removed. • Finally, the recipient views the message as if it were sent directly.
Chapter 3 Protocol 3.2 The Layered Model3.2.4 Networking Software and Protocols • Networking software • handles the tasks of sending and receiving data • passes data up and down the protocol layers • not a single program • multiple programs corresponding to the OSI model • Protocol stack or protocol suite • the multiple programs corresponding to the OSI model • e.g. TCP/IP
Chapter 3 Protocol 3.3 TCP/IP (1/2) • TCP/IP (Transmission Control Protocol/ Internet Protocol) is • not a single protocol • is a protocol stack or protocol suite • with a set of protocols • Components of TCP/IP are • TCP • IP • SMTP • Telnet • FTP • HTTP • HTTPS • UDP • ARP
Chapter 3 Protocol 3.3 TCP/IP (2/2) • TCP • responsible for • breaking a message into packets • re-assembling them at the destination • re-sends packets which have errors during transmission. • IP • operates at a level just below TCP • adding and removing the IP addresses used in packets • routing packets through the network.
Chapter 3 Protocol 3.3 TCP/IP3.3.2 Pros and Cons of TCP/IP (1/2) • The advantages of TCP/IP are: • Avoiding monopolisation by certain users. • Even distribution of load between channels. • If part of the network fails, communication can go on. • The entire messages is guaranteed to be transmitted. • If a packet is not received properly, the receiver computer would request for re-transmission. • Allowing computers of different hardware and software to communicate
Chapter 3 Protocol 3.3 TCP/IP3.3.2 Pros and Cons of TCP/IP (2/2) • The major disadvantage of TCP/IP is • not designed for transmitting real-time signals, • like live voice or video. • packets may arrive out of sequence and or got lost • impossible to re-transmit real-time signals • quality suffers • Solved by Quality of Service (QoS) • allowing traffic to be prioritized
Chapter 3 Protocol 3.4 IP address (1/2) • IP address is • is unique identifier of • computers, and • some connecting devices, e.g. routers • is logical (compare with MAC address which is physical) • is 32 bits (4 bytes) long • resulting in 4.3 billion (232 ~ 4.3 × 109) addresses theoretically. • 4 numbers from 0 to 255, separated by periods • e.g. 202.148.153.49
Chapter 3 Protocol 3.4 IP address (2/2) • Every packet carries • IP addresses of • the sender and • receiver. • A router keeps • a table of IP addresses of other computers
Chapter 3 Protocol 3.4.1Global and Internal IP addresses (1/3) • Global IP address(also called registered IP address) • is routable • understood by the routers on the Internet • is precious resources • managed by ICANN (Internet Corporation for Assigned Names and Numbers). • Each network is assigned with only a few global IP addresses, • used in mail server, Web server and routers etc. • As the Internet grows rapidly, global IP addresses will be used up finally.
Chapter 3 Protocol 3.4.1Global and Internal IP addresses (2/3) • Local IP addresses (also called internal or private IP addresses) • are not routable • cannot be used on the Internet • identify computers within a network • 10.x.x.x., 172.16.x.x., 192.168.x.x • the choice is based on • the size of the network • up to the discretion of the network adminstrator • The same internal IP address may be used by computers in other networks.
Chapter 3 Protocol 3.4.1Global and Internal IP addresses (3/3) • Local IP addresses
Chapter 3 Protocol 3.4.2 IP Address and Port Number • Port number • between 0 and 65,535 • combines with IP address • The combination is called socket • for bi-directional communication link between two programs • of the Web server and Web browser • so that received data will be directed to the correct program • Port numbers between 0 and 1,023 are reserved • e.g. HTTP: 80, FTP: 21 • Port numbers in the range 1,024 to 49,151 • used by NAT • to identify workstations in a LAN connected to the Internet
Chapter 3 Protocol 3.4.3 Conversion between Local and Global Addresses (1/2) • Network Address Translation (NAT) • maintains an address translation table and rewrites the IP address in the header of each incoming and outgoing packet. • 3 main purposes: • Translate between internal and global IP addresses • Enable computers to share global IP addresses, using • publicly available yet unused IP address, or • port numbers • Provide protection by hiding internal IP addresses
Chapter 3 Protocol 3.4.3 Conversion between Local and Global Addresses (2/2)
Chapter 3 Protocol 3.4.4 Assigning IP addresses • Two ways to assign IP address: • manually assigning static addresses to devices • automatically assigning dynamic address by • Dynamic Host Configuration Protocol (DHCP) • Devices with static IP address: • servers • network printers • routers • Global IP addresses can be static or dynamic, depending on the ISP • e.g. IP address for a home user is dynamic • by the DHCP of the ISP’s server
Chapter 3 Protocol 3.4.5 Problems with Global IP address • IPv4 (IP version 4) • current addressing scheme • uses 32-bit binary numbers • run out soon due to rapid growth of the Internet • always-on Internet connections • mobile wireless devices • both require globally unique IP address
Chapter 3 Protocol 3.4.5 Problems with Global IP addressA. Current Solutions • The problem of scarcity of address in IPv4 • solved by NAT • use port numbers to extend the global IP address
Chapter 3 Protocol 3.4.5 Problems with Global IP addressB. IPv6 • IPv6 (IP version 6) • in early stage of deployment • uses 128 bits for each IP address • e.g. 2031:32C5:130F:0:0:09C0:876A:130B • allow up to 1015 endpoints in total • enough for individual computers and devices. • built-in security -- IPSec • protect data by encryption • mainly used in • mobile phones, high-end videoconferencing and privacy extension.
Chapter 3 Protocol 3.4.6 IP and MAC address (1/2)
Chapter 3 Protocol 3.4.6 IP and MAC address (2/2)
Chapter 3 Protocol 3.5 Subnetwork (1/3) • An IP address is logically divided into two parts: • prefix NetID • identifies a network • suffix HostID • identifies a computer on that network • Note: Subscribers of an ISP have the same NetID • - explains why the location of anyone can be identified from the global IP address
Chapter 3 Protocol 3.5 Subnetwork (2/3) • Why dividing an IP address? • improvesrouting efficiency • reduces the size of routing tables in routers • by storing the NetID of major networks • e.g. as the ISP’s network • allows network management easier • by breaking a large network into smaller ones • –known as SUBNETTING • e.g. a school can be subnetted to networks • for students, and • for administration.
Chapter 3 Protocol 3.5 Subnetwork (3/3)
Chapter 3 Protocol 3.5.1 Notation and Size of Network (1/2) • CIDR (Classless Inter-Domain Routing) • IP address/n, where n = bits for NetID • Ex.1 202.148.153.49/24 • 24 bits (3 bytes) for NetID • HostID may vary from 0 to 255 • but, 0 and 255 are reserved. • The maximum size of the network is 254 hosts
Chapter 3 Protocol 3.5.1 Notation and Size of Network (2/2) • Ex.2 128.10.0.0/16 • 16 bits (2 bytes) for NetID • HostID may vary from 0 to 65,535 • but, 0 and 65,535 are reserved. • The maximum size of the network is 65,534 hosts • Ex.3 192.168.0.32/28 • 28 bits (3.5 bytes) for NetID • HostID may vary from 0 to 15 • but, 0 and 15 are reserved. • The maximum size of the network is 14 hosts
Chapter 3 Protocol 3.5.2 Subnet Mask • Subnet mask • stored with each IP address • specifies the boundary between NetID and HostID • determines the maximum size of a network • 32 bits long • 1…..1 followed by 0 ….. 0 • e.g. For 24-bit NetID, the subnet mask is 11111111 11111111 11111111 000000002 (255.255.255.010). • The amount of 0’s = number of bits for HostID • but, HostID with all 0’s and all 1’s are reserved.
Chapter 3 Protocol 3.5.3 Special IP Address (1/3) • A. Network Address • HostID with all 0’s • e.g. 128.10.0.0/16 • denotes a network • B. Broadcasting Address • HostID with all 1’s • broadcasts a packet to all hosts on a network • called directed broadcasting • e.g. 128.10.255.255/16 • broadcasts to network 128.10.0.0. Limited broadcasting: 255.255.255.255 used when a computer starts up
Chapter 3 Protocol 3.5.3 Special IP Address (2/3) • C. This Computer Address • 0.0.0.0 • used to identify a computer when it boots • for communicating with other computers • D. Loopback Address • 127.x.x.x • e.g. 127.0.0.0 is called localhost • used by programmers to test the communication capability of a program • no packets ever leave a computer
Chapter 3 Protocol 3.5.3 Special IP Address (3/3)
Chapter 3 Protocol Classful Network (1/3) • The size of network is • determined by the first four bits of an address • not by the subnet mask • Class A size = 224 - 2 = 16,777,214 hosts • Class B size = 216 - 2 = 65,534 hosts • Class C size = 28 - 2 = 254 hosts
Chapter 3 Protocol Classful Network (2/3)
Chapter 3 Protocol Classful Network (3/3) • used in specifying size of a LAN