School of Engineering and Computer Science Victoria University of Wellington Copyright: Peter Andreae, VUW IRC, parsing, protocols COMP 112 2014 # 25.

Slides:



Advertisements
Similar presentations
Extended DISC Online System User Instruction: How to Run a Work Pairing.
Advertisements

Peter Andreae Computer Science Victoria University of Wellington Copyright: Peter Andreae, Victoria University of Wellington Prolog COMP 112 #
ECS 15 if and random. Topic  Testing user input using if statements  Truth and falsehood in Python  Getting random numbers.
Heidi Newton Peter Andreae Artificial Intelligence.
Real-Time Authentication Using Digital Signature Schema Marissa Hollingsworth BOISECRYPT ‘09.
CS Lecture 03 Outline Sed and awk from previous lecture Writing simple bash script Assignment 1 discussion 1CS 311 Operating SystemsLecture 03.
Online Chess Project 3 Due date: April 17 th. Introduction Third in series of three projects This project focuses on adding online support –2 players.
CS 280 Data Structures Professor John Peterson. Lexer Project Questions? Must be in by Friday – solutions will be posted after class The next project.
Guide To UNIX Using Linux Third Edition
COS 420 DAY 24. Agenda Assignment 5 posted Chap Due May 4 Final exam will be take home and handed out May 4 and Due May 10 Student evaluations Latest.
Introduction 1 Lecture 7 Application Layer (FTP, ) slides are modified from J. Kurose & K. Ross University of Nevada – Reno Computer Science & Engineering.
Internet Relay Chat Chandrea Dungy Derek Garrett #29.
C++ Programming Language Day 1. What this course covers Day 1 – Structure of C++ program – Basic data types – Standard input, output streams – Selection.
Extended DISC Online System User Instruction: How to Create a New Account.
Introduction 1-1 Chapter 2 FTP & Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 IC322 Fall.
FTP File Transfer Protocol. Introduction transfer file to/from remote host client/server model  client: side that initiates transfer (either to/from.
Regular Expressions. String Matching The problem of finding a string that “looks kind of like …” is common  e.g. finding useful delimiters in a file,
Peter Andreae Computer Science Victoria University of Wellington Copyright: Peter Andreae, Victoria University of Wellington Java Programs COMP 102 #3.
Peter Andreae Computer Science Victoria University of Wellington Copyright: Peter Andreae, Victoria University of Wellington Review COMP 102 #
Peter Andreae Computer Science Victoria University of Wellington Copyright: Peter Andreae, Victoria University of Wellington Arrays COMP 102 # T1.
Advanced Shell Programming. 2 Objectives Use techniques to ensure a script is employing the correct shell Set the default shell Configure Bash login and.
The Little Caesars Cory, Sean, Seth, James, Madison.
IT 424 Networks2 IT 424 Networks2 Ack.: Slides are adapted from the slides of the book: “Computer Networking” – J. Kurose, K. Ross Chapter 2: Application.
Application Protocols: ELECTRONIC MAIL (SMTP, POP) CSNB534 Semester 2, 2007/2008 Asma Shakil.
FTP (File Transfer Protocol) & Telnet
Peter Andreae Computer Science Victoria University of Wellington Copyright: Peter Andreae, Victoria University of Wellington Summary and Exam COMP 102.
Introduction to Python
Simple Mail Transfer Protocol (SMTP)
School of Engineering and Computer Science Victoria University of Wellington Copyright: Peter Andreae, VUW Networking COMP # 21.
Trouble-shooting Tips Georgia Bulldogs I can receive, but not send messages  If you can successfully receive messages, but can’t send.
FTP Server and FTP Commands By Nanda Ganesan, Ph.D. © Nanda Ganesan, All Rights Reserved.
XP New Perspectives on The Internet, Sixth Edition— Comprehensive Tutorial 5 1 Downloading and Storing Data Using FTP and Other Services to Transfer and.
COMP Parsing 2 of 4 Lecture 22. How do we write programs to do this? The process of getting from the input string to the parse tree consists of.
School of Engineering and Computer Science Victoria University of Wellington Copyright: Peter Andreae david streader, VUW Echo Networking COMP
Medieval Netwars By: Josh Allman, David Keegan
Xiaoying Gao Computer Science Victoria University of Wellington Copyright: Xiaoying Gao, Peter Andreae, Victoria University of Wellington Call a Method,
Web Site Access Control with Apache Fort Collins, CO Copyright © XTR Systems, LLC Web Site Access Control Using the Apache Web Server Instructor: Joseph.
Peter Andreae Computer Science Victoria University of Wellington Copyright: Peter Andreae, Victoria University of Wellington2012 More Collections: Queues,
1 SMTP - Simple Mail Transfer Protocol –RFC 821 POP - Post Office Protocol –RFC 1939 Also: –RFC 822 Standard for the Format of ARPA Internet Text.
Real-time multimedia and communication in packet networks Asterisk AGI and Manager Interface.
Peter Andreae Computer Science Victoria University of Wellington Copyright: Peter Andreae, Victoria University of Wellington 2D arrays COMP 102 # T1.
COMP Parsing 3 of 4 Lectures 23. Using the Scanner Break input into tokens Use Scanner with delimiter: public void parse(String input ) { Scanner.
Scanning & Enumeration Lab 3 Once attacker knows who to attack, and knows some of what is there (e.g. DNS servers, mail servers, etc.) the next step is.
School of Engineering and Computer Science Victoria University of Wellington Copyright: Peter Andreae, VUW Networking COMP # 22.
School of Engineering and Computer Science Victoria University of Wellington Copyright: Peter Andreae david streader, VUW Networking and Concurrency COMP.
Xiaoying Gao Computer Science Victoria University of Wellington Copyright: Xiaoying Gao, Peter Andreae, Victoria University of Wellington Exercise, printf,
School of Engineering and Computer Science Victoria University of Wellington Copyright: Peter Andreae, VUW AI for games: min-max search COMP #
1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Dynamic Host Configuration Protocol (DHCP)
Protocols COM211 Communications and Networks CDA College Olga Pelekanou
Chapter 13 Session Layer. OSI Application Presentation Session Transport Network Data Link Physical Functions of Session Layer Interhost Communication.
Compiler Construction By: Muhammad Nadeem Edited By: M. Bilal Qureshi.
Peter Andreae Computer Science Victoria University of Wellington Copyright: Peter Andreae, Victoria University of Wellington Loops and Input COMP 102 #
Peter Andreae Computer Science Victoria University of Wellington Copyright: Peter Andreae, Victoria University of Wellington 2D arrays COMP 102 # T1.
Peter Andreae Computer Science Victoria University of Wellington Copyright: Peter Andreae, Victoria University of Wellington Java Programs COMP 102 #3.
Peter Andreae Computer Science Victoria University of Wellington Copyright: Peter Andreae, Victoria University of Wellington Summary and Exam COMP 102.
Peter Andreae Computer Science Victoria University of Wellington Copyright: Peter Andreae, Victoria University of Wellington Programs with Choice Booleans,
Trouble-shooting Tips Georgia Bulldogs I can receive, but not send messages  If you can successfully receive messages, but can’t send messages,
1 Kyung Hee University Chapter 22 Simple Mail Transfer Protocol (SMTP)
Netprog: Chat1 Chat Issues and Ideas for Service Design Refs: RFC 1459 (IRC)
School of Engineering and Computer Science Victoria University of Wellington Copyright: Peter Andreae david streader, VUW Echo Networking COMP
Echo Networking COMP
CS 330 Class 7 Comments on Exam Programming plan for today:
COMP261 Lecture 18 Parsing 3 of 4.
Module 4 Remote Login.
What Are They? Who Needs ‘em? An Example: Scoring in Tennis
Chat Refs: RFC 1459 (IRC).
R.Rajkumar Asst.Professor CSE
What Are They? Who Needs ‘em? An Example: Scoring in Tennis
Planning and Storyboarding a Web Site
Presentation transcript:

School of Engineering and Computer Science Victoria University of Wellington Copyright: Peter Andreae, VUW IRC, parsing, protocols COMP # 25

COMP112 25: 2 Menu Networking and Concurrency Admin Test results Wed Tutorial & Thursday Lecture: review of test and graphics assign. No Tutorial Wed 14 (Graduation Ceremony)

COMP112 25: 3 IRC login Login sequence:  NICK pondy  USER pondy 0 unused :Peter Andreae  …lots of messages… including grumbling about looking up hostname  :irc.ecs.vuw.ac.nz.net 001 pondy …….  :irc.ecs.vuw.ac.nz.net 002 pondy …….  :irc.ecs.vuw.ac.nz.net 003 pondy …….  :irc.ecs.vuw.ac.nz.net 004 pondy irc.ecs.vuw.ac.nz hybrid …. or  :irc.ecs.vuw.ac.nz.net 433 * pondy :Nickname is already in use

COMP112 25: 4 Protocols Rules of interaction format/structure of messages rules about what messages have to be sent when. Some network applications have complex protocols; IRC has a fairly simple protocol, especially client-server. messages are simple very little constraint on the interaction. login PING.. PONG response rules on joining channels, controlling channels, etc

COMP112 25: 5 Message structure format: source command arg arg arg … final-extended-argument \r\n space separated source is optional: client messages usually have no source server messages usually (always?) have the source command is either uppercase word JOIN, PING, PRIVMSG,… three digit number 004, 433…. arguments are optional final extended argument is optional and it can contain spaces. Channel names (in arg’s) start with #, or &

COMP112 25: 6 Message structure How do you tell the difference between source command arg arg and command arg arg arg command extended-arg the source must start with a : the command does not start with a : :irc.ecs.vuw.ac.nz PING zxsdfw \r\n PING sdfafff ewrrrf\r\n The extended argument must start with a : everything from the : to the end of line is the argument PRIVMSG ChatBot :This is a message for you \r\n

COMP112 25: 7 Parsing the message String line = input.nextLine(); Scanner lineScanner = new Scanner(line); String source = “”; String command = lineScanner.next(); if (command.startsWith(“:”) ){ source = command.substring(1); command = lineScanner.next(); } read the arguments, one at a time. checking if start with : Do you check for the : before or after reading the token? after: now have to put the arguments “back” into the rest of line. before: how?

COMP112 25: 8 Scanner hasNext(String pattern) hasNext() true iff there is any token in the input hasNextInt() true iff there is a token and it is an integer hasNext(“A.B*”) true iff there is a token and it matches the pattern “A.B*” Pattern language:. means “any character” * means “any number of repetitions of the previous (including zero)” AxBBBBBB, A!B AA lots more options for specifiying more complex patterns. Can use this to “peek” at the next token to see if it matches a required pattern before you read it.

COMP112 25: 9 Protocol rules NICK message required from client If the is a PASS message (password), it must precede the NICK message. When the server sends a PING message, the client must respond quickly with a PONG, else client will be disconnected When server sends a list of channel names, there is one message for each name, with a final message to indicate the end of list (commands 322 and 323). ….

COMP112 25: 10 Other Networking Issues Encryption How can you ensure that only the intended recipient can read the message. Authentication. How can you be sure that the message you got came from the sender it claims to be from. protocol is not authenticated! irc server might require authentication (irc.ecs.vuw.ac.nz doesn’t) How can you authenticate a message?

COMP112 25: 11 AI: Games Where is AI used in Games?

COMP112 25: 12 Min-Max search 2-person, turn-taking games (eg, board games)

It’s O’s turn. What should they do? What should O do? 13

O’s choice X’s Choice It’s O’s turn: what should O do? Work backwards to determine status of earlier positions X will try to make O lose

O’s choices O’s choice X’s Choice It’s O’s turn: what should O do? Work backwards to determine status of earlier positions O will try to win

O’s choice X’s Choices It’s O’s turn: what should O do? Work backwards to determine status of earlier positions X will try to make O lose

O’s choice It’s O’s turn: what should O do? Work backwards to determine status of earlier positions O will try to win