CS455: Introduction to Distributed Systems [Spring 2019] Dept. Of Computer Science, Colorado State University

Similar documents
CS455: Introduction to Distributed Systems [Spring 2018] Dept. Of Computer Science, Colorado State University

CS555: Distributed Systems [Fall 2017] Dept. Of Computer Science, Colorado State University

CS455: Introduction to Distributed Systems [Spring 2018] Dept. Of Computer Science, Colorado State University

CS555: Distributed Systems [Fall 2017] Dept. Of Computer Science, Colorado State University

CS 455: INTRODUCTION TO DISTRIBUTED SYSTEMS [DISTRIBUTED MUTUAL EXCLUSION] Frequently asked questions from the previous class survey

CS455: Introduction to Distributed Systems [Spring 2018] Dept. Of Computer Science, Colorado State University

CS370: Operating Systems [Spring 2016] Dept. Of Computer Science, Colorado State University

CS555: Distributed Systems [Fall 2017] Dept. Of Computer Science, Colorado State University

Frequently asked questions from the previous class survey

CS455: Introduction to Distributed Systems [Spring 2018] Dept. Of Computer Science, Colorado State University

L3: Building Direct Link Networks I. Hui Chen, Ph.D. Dept. of Engineering & Computer Science Virginia State University Petersburg, VA 23806

CS555: Distributed Systems [Fall 2017] Dept. Of Computer Science, Colorado State University

CMSC433 - Programming Language Technologies and Paradigms. Introduction

CS555: Distributed Systems [Fall 2017] Dept. Of Computer Science, Colorado State University

San José State University Department of Computer Science CS151, Section 04 Object Oriented Design Spring 2018

CS455: Introduction to Distributed Systems [Spring 2018] Dept. Of Computer Science, Colorado State University

Distributed Systems COMP 212. Lecture 1 Othon Michail

Direct Link Networks. Lecture - Encoding & Framing 1. Areas for Discussion. Problems

San Jose State University College of Science Department of Computer Science CS151, Object-Oriented Design, Sections 1,2 and 3, Spring 2017

CS370: System Architecture & Software [Fall 2014] Dept. Of Computer Science, Colorado State University

SWE3004: Operating Systems. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

CNT 4004: Computer Networks I. Tentative Syllabus

EEC-484/584 Computer Networks

CS 200, Section 1, Programming I, Fall 2017 College of Arts & Sciences Syllabus

CSC6290: Data Communication and Computer Networks. Hongwei Zhang

Syllabus CSCI 405 Operating Systems Fall 2018

ESET 369 Embedded Systems Software, Fall 2017

Frequently asked questions from the previous class survey

CS370: Operating Systems [Spring 2016] Dept. Of Computer Science, Colorado State University

CS 471 Networking and Distributed Operating Systems

ESET 369 Embedded Systems Software, Spring 2018

Course Syllabus - CNT 4703 Design and Implementation of Computer Communication Networks Fall 2011

CSC 280 Operating System Principles

Telecommunications II TEL 202 Spring, 2004

ISM 324: Information Systems Security Spring 2014

Lecture 3: Modulation & Layering"

programming exercises.

CSCI-1680 Physical Layer Link Layer I Rodrigo Fonseca

SSE3044: Operating Systems

ECE 4450:427/527 - Computer Networks

CSCI 201L Syllabus Principles of Software Development Spring 2018

Frequently asked questions from the previous class survey

Distributed Systems COMP 212. Lecture 1 Othon Michail

CS 470G Introduction to Operating Systems

Office Hours Time: Monday/Wednesday 12:45PM-1:45PM (SB237D) More Information: Office Hours Time: Monday/Thursday 3PM-4PM (SB002)

Distributed Systems COMP 212. Lecture 1 Othon Michail

Introduction to Computer Systems

Computer Networking Background

Frequently asked questions from the previous class survey

L1: Introduction. Hui Chen, Ph.D. Dept. of Engineering & Computer Science Virginia State University Petersburg, VA 23806

NEW YORK CITY COLLEGE OF TECHNOLOGY/CUNY Computer Systems Technology Department

Frequently asked questions from the previous class survey

San José State University Computer Science Department CS49J, Section 3, Programming in Java, Fall 2015

CS370: System Architecture & Software [Fall 2014] Dept. Of Computer Science, Colorado State University

CMPS 182: Introduction to Database Management Systems. Instructor: David Martin TA: Avi Kaushik. Syllabus

CS 241 Data Organization using C

Kingdom of Saudi Arabia Ministry of Higher Education College of Computer & Information Sciences Majmaah University. Course Profile

San Jose State University College of Science Department of Computer Science CS151, Object-Oriented Design, Sections 1, 2, and 3, Spring 2018

Frequently asked questions from the previous class survey

Database Management Systems CS Spring 2017

IT 341 Fall 2017 Syllabus. Department of Information Sciences and Technology Volgenau School of Engineering George Mason University

Java RMI Middleware Project

Course Administration

Distributed Systems. Wintersemester - Winter Term 2003

CS 425 / ECE 428 Distributed Systems Fall 2017 Indranil Gupta (Indy) August 29 December 12, 2017 Lecture 1-29

ECE 4450:427/527 - Computer Networks Spring 2017

ECE Object-Oriented Programming using C++ and Java

Course and Contact Information. Course Description. Course Objectives

Textbook(s) and other required material: Raghu Ramakrishnan & Johannes Gehrke, Database Management Systems, Third edition, McGraw Hill, 2003.

Electrical and Computer Engineering Technology

San Jose State University College of Science Department of Computer Science CS185C, Introduction to NoSQL databases, Spring 2017

CMPE 280 Web UI Design and Development

CS370: System Architecture & Software [Fall 2014] Dept. Of Computer Science, Colorado State University

CMPE 150/L : Introduction to Computer Networks

Data Communications & Computer Networks

Introduction to Programming System Design CSCI 455x (4 Units)

CS555: Distributed Systems [Fall 2017] Dept. Of Computer Science, Colorado State University

Module 2 Overview of Computer Networks

Module 2 Overview of. Computer Networks

EEC-484/584 Computer Networks

IT4405 Computer Networks (Compulsory)

New Undergraduate Course Proposal Form

Links. CS125 - mylinks 1 1/22/14

Frequently asked questions from the previous class survey

Course and Contact Information. Course Description. Course Objectives

CS370: Operating Systems [Spring 2017] Dept. Of Computer Science, Colorado State University

KOMAR UNIVERSITY OF SCIENCE AND TECHNOLOGY (KUST)

Faculty of Sciences and Information Technology

CSC 111 Introduction to Computer Science (Section C)

Syllabus COSC-051-x - Computer Science I Fall Office Hours: Daily hours will be entered on Course calendar (or by appointment)

TTh 9.25 AM AM Strain 322

Overview. Performance metrics - Section 1.5 Direct link networks Hardware building blocks - Section 2.1 Encoding - Section 2.2 Framing - Section 2.

San Jose State University College of Science Department of Computer Science CS185C, NoSQL Database Systems, Section 1, Spring 2018

CS370: Operating Systems [Spring 2017] Dept. Of Computer Science, Colorado State University

CS 240 Fall 2015 Section 004. Alvin Chao, Professor

San Jose State University College of Science Department of Computer Science CS151, Object-Oriented Design, Sections 1 and 2, Spring 2016

Chapter 8 OSI Physical Layer

6.088/6.084 Robotics Project Subject Information and Syllabus

CSci 4211: Data Communications and Computer Networks. Time: Monday and Wednesday 1 pm to 2:15 pm Location: Vincent Hall 16 Spring 2016, 3 Credits

Distributed Systems

Transcription:

CS 455: INTRODUCTION TO DISTRIBUTED SYSTEMS [INTRODUCTION] The Road Ahead From ports to packets and thence onto sockets Over which the data must traverse Unravel the intricacies of threads So that dance to your code's tunes the CPUs must Topics covered in this lecture Introduction Course overview and expectations Communications Write code that can scale Over so many computers, and oh so much data, That convinced others are that it must be a tall tale Of distributed elections, coordination, mutual exclusion and consensus And topologies that scale, and sustain failures without even a dash of human intervention Shrideep Pallickara Computer Science Colorado State University L1.1 L1.2 What is a distributed system? A distributed system is one in which hardware and software components located at networked computers communicate and coordinate their actions only by passing messages. Coulouris, Dollimore, Kindberg and Blair DISTRIBUTED SYSTEMS QUICK OVERVIEW A distributed system is one in which the failure of a computer you didn't even know existed can render your own computer unusable. Leslie Lamport L1.3 L1.4 Why Distributed Systems? Your hard-drive s primacy has been eroding Data and programs are delivered over the network No single hard drive can hold all the data you need Services themselves are distributed Google search is backed by a massive distributed cloud Distributed systems builds on a diverse set of areas Networking Concurrency Algorithms and Graph Theory Cryptography Failure recovery and consistency models Probability theory Machine learning Information Retrieval Transactional Systems L1.5 L1.6 SLIDES CREATED BY: SHRIDEEP PALLICKARA L1.1

Distributed Systems: CHALLENGES [1/2] Scale with increases in data and users Responsiveness Regardless of data size, responses must be prompt Intelligent Correlate all sorts of information Distributed Systems: CHALLENGES [2/2] Dealing with system conditions Murphy s Law Malicious Users Byzantine failures Security Detection Privacy and Accountability Authorizations L1.7 L1.8 About me ABOUT ME I do research in this area Areas that I have worked or actively work in include: Cloud computing and analytics Internet-of-Things (IoT) Big Data Content dissemination and streaming systems Grid computing P2P systems Object Request Brokers L1.9 L1.10 My research has been deployed in Commercial internet conferencing systems Defense applications Earthquake sciences Epidemic modeling Environmental monitoring Healthcare informatics & Brain Computer Interfaces High energy physics Visualizations COURSE LOGISTICS, EXPECTATIONS, AND SUCH L1.11 L1.12 SLIDES CREATED BY: SHRIDEEP PALLICKARA L1.2

Course webpage All course materials will be on the course webpage http://www.cs.colostate.edu/~cs455 Schedule Lectures Assignments Infospaces, Syllabus and Announcements Grades will be posted on Canvas There is also a link to the CS455 Pizza forum on the course webpage FAQs and discussions for assignments The course website, Piazza, Checkin, and Canvas are all live now Office Hours Professor: Shrideep Pallickara Computer Science (CSB 364) Office Hours: 4:00 5:00 PM Tuesday and 9:00 10:00 AM Friday GTA: Office hours will be in CSB 120 Kevin Bruhwiler 2:00-4:00 pm Monday and 2:00-4:00 pm Wednesday Bibek Shrestha. 2:00-3:00 pm && 5:00-6:00 pm Tuesday and 2:00-3:00 pm && 5:00-6:00 pm Friday Lab Sessions: CSB 130 from 4:00 5:00 pm on Friday Please send all e-mails to: compsci_cs455@colostate.edu L1.13 L1.14 Course textbook This class has two optional textbooks Distributed Systems: Principles and Paradigms. Andrew S. Tanenbaum and Maarten Van der Steen. 3rd Edition. Createspace, ISBN 9781530281756 Distributed Systems: Concepts and Design. George Coulouris, Jean Dollimore, Tim Kindberg, Gordon Blair. 5th Edition. Addison Wesley. ISBN: 978-0132143011 When I make slides I usually refer to several texts And technical papers and articles (with URLs) I always list my references at the end of every slide set L1.15 L1.16 Textbooks that I will refer to during the course include (1/2) Distributed Systems: Principles and Paradigms. Andrew S. Tanenbaum and Maarten Van der Steen. 2nd Edition. Prentice Hall. ISBN: 0132392275/978-0132392273. Distributed Systems: Concepts and Design. George Coulouris, Jean Dollimore, Tim Kindberg, Gordon Blair. 5th Edition. Addison Wesley. ISBN: 978-0132143011 Distributed Computing: Principles, Algorithms, and Systems. Ajay Kshemkalyani and Mukesh Singhal. 1st edition. Cambridge University Press. ISBN: 0521876346/ 978-0521876346 Computer Networks: A Systems Approach. Larry Peterson and Bruce Davie. 4th edition. Morgan Kaufmann. ISBN: 978-0-12-370548-8. Java Concurrency in Practice. Brian Goetz, Tim Peierls, Joshua Bloch, Joseph Bowbeer, David Holmes, and Doug Lea. Addison-Wesley Professional. ISBN: 0321349601/978-0321349606. Java Threads. Scott Oaks and Henry Wong.. 3rd Edition. O Reilly Press. ISBN: 0-596- 00782-5/978-0-596-00782-9 Textbooks that I will refer to during the course include (2/2) Hadoop: The Definitive Guide. Tom White. 3rd Edition. Early Access Release. O Reilly Press. ISBN: 978-1-449-31152-0 Concurrent Programming in Java(TM): Design Principles and Pattern. Doug Lea. 2nd Edition. Prentice Hall. ISBN: 0201310090/978-0201310092. Cloud Application Architectures: Building Applications and Infrastructure in the Cloud. George Reese.1st edition. O'Reilly. ISBN: 0596156367/978-0596156367. Practical Cryptography. Niels Ferguson and Bruce Schneier. 1st edition. Wiley Publishing. ISBN: 0-471-22894-X/0-471-22357-3. Unix Systems Programming. Kay Robbins & Steve Robbins, 2nd edition. Prentice Hall. ISBN: 978-0-13-042411-2. Operating Systems Concepts. Avi Silberschatz, Peter Galvin, Greg Gagne. 8th edition. John Wiley & Sons, Inc. ISBN-13: 978-0-470-12872-5. L1.17 L1.18 SLIDES CREATED BY: SHRIDEEP PALLICKARA L1.3

On the Course schedule page http://www.cs.colostate.edu/~cs455/schedule.html You will see the topics that will be covered and the order in which I will cover them The readings section will list the books (and the chapters therein) that form the basis for the materials You will also see the complete schedule for when the assignments are posted and when they are due Infospaces New knowledge repository that we are building to enhance learning All videos are designed to be less than 2 minutes Improving Infospaces Let us know what you would like to see If you d like to contribute to this repository let us know! L1.19 L1.20 Grading breakdown GRADING Assignments: 55% HW1: 15%; HW2: 20%; HW3: 20% Term project and paper: 10% Term project presentation: 5% Quizzes (10 best) : 10% Midterm: 10% Final exam: 10% L1.21 L1.22 Grading Policy [1/4] Letter grades will be based on the following standard breakpoints: >= 90 is an A, >= 88 is an A-, >= 86 is a B+, >=80 is a B, >=78 is a B-, >= 76 is a C+, >=70 is a C, >= 60 is a D, and <60 is an F. Grading Policy [2/4] There is no extra credit Any credit you earn, you must do so on a level-playing field with your peers There will be no make-up exams I will not cut higher than this, but I may cut lower. L1.23 L1.24 SLIDES CREATED BY: SHRIDEEP PALLICKARA L1.4

Grading Policy [3/4] Every assignment will be posted at least 4 weeks before the due date. Every assignment will include information about: How much it will count towards the course grade How it will be graded Late submission penalty: 7.5% per-day for the first 2 days Submissions after the late submission period will have an automatic ZERO If you submit the wrong files and notice after 2 days? 40% deduction Detailed submission instructions posted on the course website. Assignments will be graded within 2 weeks of submission Grading Policy [4/4] If you have problems with the grading Talk to the GTA first The GTA will strive to ensure that the grading is consistent across the board L1.25 L1.26 Quizzes, midterm, and final Each account for 10% of the course grade Final is comprehensive There will be 13 in-class quizzes 3 quizzes where you had your lowest scores will be dropped n We will take your 10 highest scores If you have an interview or need to miss class for some reason, you do not need to let me know and there will be NO MAKEUP for quizzes (please don t ask to do this!) n Exceptions with documentation: University sanctioned absences, medical emergencies, personal loss Quizzes Are held at the end of class, Quizzes will have checkboxes that require to indicate if you were On-time or less than 15 minutes late: No deductions 15+ minutes late (20% deduction), 30+ minutes late (40% deduction), 45+ minutes late (60% deduction), 60+ minutes late (80% deduction) n This is self-reported. Failure to report, doubles the deduction L1.27 L1.28 Quizzes, mid term, and final I will only ask questions about what I teach If the concepts were covered in my slides You should be be able to answer the questions ASSIGNMENTS CS455 is a capstone course So there are writing components L1.29 L1.30 SLIDES CREATED BY: SHRIDEEP PALLICKARA L1.5

Assignments: What to expect There will be no busy work No GUI Complexity will not be through obfuscation Assignments have been designed so that they incrementally add Networking Threading Processing You will be able to look back and feel good about them Delayed gratification L1.31 L1.32 There will be 3 assignments Using Dijkstra s Shortest Paths to Route Packets in a Network Overlay Threading Assignment Analytics using MapReduce (Hadoop) Each assignment will have TWO components Programming element Written element L1.33 L1.34 Assignments: The programming component This will account for 80% of the grade for the assignment You will have about 4 weeks to complete each assignment The assignments will include milestones that should be achieved for each week Assignments: The written component This will account for 20% of the grade for the assignment You will have 48 hours to complete this The questions will be reflective Design decisions, extensions, optimizations, choice of data structures, etc. Will be posted after the programming portion is due Please submit the written component EVEN IF you have not completed the programming assignment L1.35 L1.36 SLIDES CREATED BY: SHRIDEEP PALLICKARA L1.6

Term project [1/2] Term project [1/2] This will be based on Apache SPARK Term project deliverables Source codes [7 points] Term Project Report [3 points] Term Project Presentation [5 points] The term project is a group effort Team size = 2-3 and you can choose your teammate Please respond to your teammate s e-mails on time! n Make sure he/she has the e-mail that you check regularly If you have problems finding a teammate, please let us know L1.37 L1.38 Assignments: Logistics Assignments will be due at 5:00 pm Programming assignments are due on Wednesdays Written assignments are due on Fridays You are allowed to submit up to 2 days late There is a 7.5% deduction for each day that you are late All assignments (except the term project) are individual assignments Expectations You will attend all classes You will focus on the discussions, and not on Other assignments Social networking updates Assignments have to be done individually You will be challenged in this course Assignments are geared toward real systems L1.39 L1.40 What it takes to succeed [1/3] You are required to work at least 12 hours per-week outside of class Coding and reviewing material from class If you miss a lecture Add about 3 hours per missed lecture WHAT IT TAKES TO SUCCEED L1.41 L1.42 SLIDES CREATED BY: SHRIDEEP PALLICKARA L1.7

What it takes to succeed [2/3] Work on the assignments every day There is no such thing as waiting for inspiration to strike! Reflect about how you could have done things differently for better performance Even after you have submitted an assignment It will improve the choices you make in the next assignment What it takes to succeed [3/3] Work in bigger-sized chunks Too many short bursts = Too many context switches n You will be busy doing nothing Document your code L1.43 L1.44 How to fail this course Believing that you can learn via osmosis Missing lectures If you don t have the discipline to show up, you will most likely not have the discipline to catch up Procrastinating The assignments cannot be done in a week Organize your schedule so that you can succeed Other pitfalls Poor management of course loads Plan the number and type of courses you take Don t spread yourself so thin that you do not give yourself the opportunity to succeed Not attacking the problem and working on the fringes Spend your time wisely on critical paths L1.45 L1.46 Use of laptops, cell phones, tablets, and other electronic devices If you must use a laptop or tablet you will have to Turn off wireless And use it only for taking notes Authorized laptop/tablet users Pledge forms on table Will sit in the back row starting at the corners When the class is in session, put away your cell-phones! Why attend lectures if all the slides are posted? Slides are only part of the story They anchor the discussion Any field has a language associated with it People who have worked in an area for a long time speak the language Sitting in classes helps you learn how to frame questions and responses Often there are surprising questions Some of these may be asked by interviewers L1.47 L1.48 SLIDES CREATED BY: SHRIDEEP PALLICKARA L1.8

Recorded lectures are ONLY for distance students The on-campus course is the on-campus course Who wants to lecture in an empty room! Students in the on-campus section will not be given the recording links So please don t ask even if you have an interview Exceptions: University sanctioned absences, medical emergencies, personal loss Distance students should not post (or share) the EchoCenter links for the recorded lectures on the Piazza forum or any other forum. Help me help you We will have surveys at the end of every class You will provide a list of 3 concepts you followed clearly 3 concepts you had problems keeping up with Problem areas for the majority of the class will be addressed in the next class L1.49 L1.50 Interactions You can have discussions with me, the GTAs, and your peers There are two constraints to these discussions 1 No code can be exchanged under any circumstances 2 No one takes over someone else s keyboard Bumps are to be expected along the way But you should get over this yourself It will help you with the next problem you encounter TOPICS COVERED IN CS455 L1.51 L1.52 Topics covered in CS455 [1/2] Communications Threads: Safety and Concurrency Building scalable servers MapReduce Spark Topics covered in CS455 [2/2] Distributed mutual exclusion Election algorithms File systems and network storage Distributed server topologies Distributed storage systems L1.53 L1.54 SLIDES CREATED BY: SHRIDEEP PALLICKARA L1.9

Example: Setting up connections to a server Programs open a socket to a server that s listening for connections To create a Socket you need to know the Internet host you want to connect to Servers don t know who will contact them If it did, difficult to synchronize when this would happen COMMUNICATIONS & NETWORKING L1.55 L1.56 An analogy Server is like a person sitting by the phone Doesn t know who will call and when When the phone rings? n Talk to whoever is on the other line Java provides a ServerSocket to enable writing servers ServerSocket runs on the server Listens for incoming network connections on a particular port on the host that it runs on When a client socket on a remote host attempts to connect to that server port 1 Server wakes up 2 Negotiates a connection between the client and server 3 Opens a regular Socket between the two hosts L1.57 L1.58 Some more about the two types of sockets ServerSockets wait for connections Client Sockets initiate connections Once the ServerSocket has set up the connection? Data always travels over the regular Socket Using the ServerSocket Created on a particular port using the ServerSocket(port) constructor Listen for communications on that port using accept() Blocks until a client attempts to make connection Returns a Socket object that connects the client to the server Use the Socket s getinputstream() and getoutputstream() to communicate L1.59 L1.60 SLIDES CREATED BY: SHRIDEEP PALLICKARA L1.10

Creating the ServerSocket ServerSocket serversocket = new ServerSocket(5000); Tries to create a server socket on port 5000 ServerSocket serversocket = new ServerSocket(5000, 100); Can hold up to 100 incoming connections ServerSocket serversocket = new ServerSocket(5000, 100, InetAddress.getHostByName ( address2.cs.colostate.edu )); On a multi-homed host, specify the network-address over which connections should be accepted Accepting network connections ServerSocket serversocket = new ServerSocket(portNum); while(true) { Socket socket = serversocket.accept();... } L1.61 L1.62 Closing the client and server sockets Closing a ServerSocket frees a port on the host that it runs on Closing a Socket breaks the connection between the local and remote hosts We exchange byte streams over the socket The java.io package contains the DataInputStream and DataOutputStream that lets you do this elegantly DataInputStream din = new DataInputStream(socket.getInputStream()); DataOutputStream dout = new DataOutputStream(socket.getOutputStream()); L1.63 L1.64 Elements that play a role in communications Transmission media Wire, cable, fiber, and wireless channels Hardware devices Routers, switches, bridges, hubs, repeaters, and network interfaces Software components Protocol stacks, communication handlers, and drivers Communications & Networking: Topics that we will cover Data transmission Switched Networks Bandwidth and Latency Multiplexing Internet Architecture IP routing The TCP and UDP protocols L1.65 L1.66 SLIDES CREATED BY: SHRIDEEP PALLICKARA L1.11

How is the data sent? COMMUNICATIONS & NETWORKING {HOW DATA IS SENT} Are we sending 1 s and 0 s? Whatever the physical medium, we use signals Electromagnetic waves traveling at the speed of light n Speed of light is different in different mediums L1.67 L1.68 Components of encoding binary data in a signal Modulation Duplexity Encoding binary data: Modulation Objective is to send a pair of distinguishable signals Vary frequency, amplitude, or phase of the signal to transmit information E.g. vary the power (amplitude) of signal x(t) =A sin(2πft + θ) L1.69 L1.70 Encoding binary data: Duplexity How many bit streams can be encoded on a link at a time? If it is one: nodes must share access to link Can data flow in both directions at the same time? Yes è full-duplex No è half-duplex For our purposes, let s ignore details of modulation Assume we are working with two signals High and low In practice: Different voltages on a copper-based link Different power-levels on an optical link L1.71 L1.72 SLIDES CREATED BY: SHRIDEEP PALLICKARA L1.12

Let s do the obvious thing Map 1 to a high signal Map 0 to a low signal Non-return to zero (NRZ) 0 0 1 0 1 1 1 1 0 1 0 0 0 0 1 0 L1.73 L1.74 Problems with NRZ because of consecutive 1 s and 0 s: BASELINE WANDER Receiver keeps average of the signal seen so far Average is used to distinguish between low and high Lots of consecutive 1/0 s will make it difficult to detect a significant change Problems with NRZ because of consecutive 1 s and 0 s: CLOCK RECOVERY Every clock cycle, sender transmits and the receiver receives Sender and receiver s clocks must be perfectly synchronized Otherwise, it is not possible to decode the signal L1.75 L1.76 Manchester encoding 0 is a low-to-high transition 1 is a high-to-low transition Manchester encoding and NRZ NRZ 0 0 1 0 1 1 1 1 0 1 0 0 0 0 1 0 Manchester Encoding L1.77 L1.78 SLIDES CREATED BY: SHRIDEEP PALLICKARA L1.13

Some more about Manchester encoding Doubles the rate at which signal transitions are made on the link Receiver has ½ the time to detect each pulse Rate of signal changes: baud rate Bit rate is ½ the baud rate Encoding is considered 50% efficient NRZI (Non return to zero inverted) Make a transition from current signal to encode a 1 Stay at current signal to encode a 0 Solves the problem of consecutive 1 s But does nothing for consecutive 0 s L1.79 L1.80 4B/5B encoding 4B/5B encoding 4B 5B Attempts to address inefficiencies in Manchester encoding Without suffering from problems due to extended high/low signals The crux here is to insert extra bits into bitstream Breakup long sequences of 1s or 0s 4 bits of actual data encoded in a 5-bit code 5-bit codes are carefully selected n No more than 1 leading 0 & no more than 2 trailing 0s 0000 11110 0001 01001 0010 10100 0011 10101 0100 01010 0110 01110 0111 01111 1000 10010 1001 10011 1010 10110 1011 10111 1100 11010 1101 11011 1110 11100 L1.81 1111 11101 L1.82 4B/5B: Rules for the conversion of 4-bit codes to 5- bit codes Objective is to ensure that in each translation there is: No more than one leading 0 No more than two trailing 0 s When sent back-to-back n No pair of 5-bit codes results in more than 3 consecutive 0 s being transmitted The contents of this slide-set are based on the following references Computer Networks: A Systems Approach. Larry Peterson and Bruce Davie. 4th edition. Morgan Kaufmann. ISBN: 978-0-12-370548-8. [Chapter 1, 2] Java Network Programming, Third Edition. Elliotte Rusty Harold. O'Reilly. ISBN-10: 0596007213 / 978-0596007218. [Chapter 7] 5-bit codes are transmitted using NRZI This is why they are so concerned with consecutive 0 s L1.83 L1.84 SLIDES CREATED BY: SHRIDEEP PALLICKARA L1.14