cheapchat: a java-based chat application nicolas ducheneaut mike gebbie barbara rosario sims, spring...

Post on 19-Dec-2015

219 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

CheapChat: a Java-based chat application

Nicolas Ducheneaut

Mike Gebbie

Barbara Rosario

SIMS, Spring 2000

Chat application with Port Scanner

• 2 modules: – Port Scanner– Chat application acting both as a

server and a client

Port Scanner

Possible Ports: (0–1023) (1024–49151) (49152-65535)

Port Scanner

Possible Ports: (0–1023) (1024–49151) (49152-45535)

findTheApplicationPort(Host Address, Start Port,

End Port )

Keep Trying…

Port Scanner

CheapChat “Client”

CheapChat “Server”

(Port 50005)

Port Scanner

CheapChat “Client”

CheapChat “Server”

(Port 50005)Try 50000…Timeout …

Port Scanner

CheapChat “Client”

CheapChat “Server”

(Port 50005)PortScanner

Invoke!

PS

Port Scanner

CheapChat “Client”

CheapChat “Server”

(Port 50005)PortScannerTry

50001…Try

50002…Try

50003…Try

50004…

PortScannerThreads

Port Scanner

CheapChat “Client”

CheapChat “Server”

(Port 50005)PortScanner

PortScannerThreads

Connect at 50005

Authenticate:

“Are you a CheapChat

server?”

Port Scanner

CheapChat “Client”

CheapChat “Server”

(Port 50005)PortScanner

PortScannerThreads Reply:

“I am a CheapChat

server!”

Port Scanner

CheapChat “Client”

CheapChat “Server”

(Port 50005)

Connect at 50005

C onnect to Server SocketSends strings to Server and receives InputS tream from the server; d ip lay it or (ifspecia l m essages) do som eth ing e lse

Chat1

ACTIVE : O pen Server SocketW ait for connectionC reate a C hatH andler ob ject

Server

C lient

ChatHandler

broadcast()

C hatH anler1run()

Chat 1: first to start Chat

Problems and potential remedies

• Main weakness: clear-text administrative messages sent over the communication channel– > Solution: use two separate data streams instead

• No way to know in advance if someone is on-line– > Solution: adapt the port scanner and use it before the application is launched

Thank you for your attention

Questions? Comments?

top related