Java Networking Protocols and Message Handling in Distributed Systems

0.0(0)
studied byStudied by 0 people
full-widthCall with Kai
GameKnowt Play
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/19

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

20 Terms

1
New cards

Protocol.java

All message type IDs as int constants so both sides agree on tags.

2
New cards

Message IDs in one file

Avoids mismatches; every sender/receiver uses the same numeric tags.

3
New cards

NodeInfo.java

Stores host, port, and a stable id (e.g., host:port) for maps/sets and logs.

4
New cards

NodeInfo equals/hashCode

So it behaves correctly in HashMap/HashSet for membership and lookups.

5
New cards

MessageIO.java

Centralized, bug-free binary IO for primitives and length-prefixed UTF-8 strings.

6
New cards

Centralize binary IO

Consistency and fewer serialization bugs across all messages.

7
New cards

Messages.java

POJO classes for each message + sendX(...) encoders and readMessage(...) decoder.

8
New cards

Single readMessage(...)

One source of truth for parsing; switches on Protocol ID.

9
New cards

Atomic writes in messages

Synchronizing on the DataOutputStream in each sendX(...).

10
New cards

GraphUtils.java

Edges, adjacency builders, and Kruskal MST for overlay/topology tasks.

11
New cards

Separate graph code from node code

Keeps networking classes focused on sockets/threads; makes graph logic testable.

12
New cards

Registry.java

Registers nodes, forms the overlay, sends link weights, initiates tasks, collects summaries.

13
New cards

Registry communication to nodes

Sends control messages (e.g., TaskInitiate, PullTrafficSummary) defined in Messages.

14
New cards

MessagingNode.java

Connects to registry, manages peer sockets, routes/relays data, tracks and reports stats.

15
New cards

Data message contents

Source ID, destination ID, payload, and a hop-by-hop route.

16
New cards

Distinct control and data paths

Control (registry) vs. data (peer-to-peer) traffic have different lifecycles and threading.

17
New cards

Overlay MST purpose

A minimal, loop-free backbone for routing/printing required by the assignment.

18
New cards

Immutable/simple POJOs for messages

Easier to serialize, test, and reason about.

19
New cards

Disagreement on message field order

Decoding breaks—hence strict, centralized encoders/decoder in Messages.

20
New cards

Main benefit of file order

You can compile/run incrementally: protocol → wireformat → graph → registry → nodes.

Explore top flashcards

latin vocab stage 40
Updated 999d ago
flashcards Flashcards (22)
Synonyms
Updated 45d ago
flashcards Flashcards (206)
DECA58
Updated 395d ago
flashcards Flashcards (58)
all of bio (Q)
Updated 1030d ago
flashcards Flashcards (463)
Urinate Sis! Pt 1
Updated 156d ago
flashcards Flashcards (23)
latin vocab stage 40
Updated 999d ago
flashcards Flashcards (22)
Synonyms
Updated 45d ago
flashcards Flashcards (206)
DECA58
Updated 395d ago
flashcards Flashcards (58)
all of bio (Q)
Updated 1030d ago
flashcards Flashcards (463)
Urinate Sis! Pt 1
Updated 156d ago
flashcards Flashcards (23)