SlideShare ist ein Scribd-Unternehmen logo
1 von 16
Downloaden Sie, um offline zu lesen
Mesh Network
Seminararbeit von Marc Egli
Montag, 1. Juli 2013
Probleme
• Rapid Prototyping?
• Test Driven Development?
Montag, 1. Juli 2013
Rapid Prototyping
• Ist einfach mit Python
• Twisted als Networking Engine
• Lauffähiger Prototyp am 17. März
Montag, 1. Juli 2013
Test Driven Development
• Gegen eine bestehendeVersion Testen
• util.py für Abläufe
Montag, 1. Juli 2013
Open Source Anmerkung
• nur mit Lizenz
Montag, 1. Juli 2013
C
Montag, 1. Juli 2013
Design Ziele
• Das Rad nicht neu erfinden
• Möglichst viele sinnvolle Threads
• Kein Eventloop
• Socket Buffer ausnutzen
Montag, 1. Juli 2013
Linked Lists
• BSD Libc hat Linked List Makros
• Lassen sich für beliebige Structs verwenden
Montag, 1. Juli 2013
/* Singly-linked List head. */
SLIST_HEAD(slisthead, entry) head =
SLIST_HEAD_INITIALIZER(head);
struct slisthead *headp;
/* Singly-linked List. */
struct entry {
...
SLIST_ENTRY(entry) entries;
...
} *n1, *n2, *n3, *np;
SLIST_INIT(&head); /* Initialize the list. */
n1 = malloc(sizeof(struct entry)); /* Insert at the head. */
SLIST_INSERT_HEAD(&head, n1, entries);
n2 = malloc(sizeof(struct entry)); /* Insert after. */
SLIST_INSERT_AFTER(n1, n2, entries);
SLIST_REMOVE(&head, n2, entry, entries);/* Deletion. */
free(n2);
n3 = SLIST_FIRST(&head);
Montag, 1. Juli 2013
/* Deletion from the head. */
SLIST_REMOVE_HEAD(&head, entries);
free(n3);
/* Forward traversal. */
SLIST_FOREACH(np, &head, entries)
np-> ...
/* Safe forward traversal. */
SLIST_FOREACH_SAFE(np, &head, entries, np_temp) {
np->do_stuff();
...
SLIST_REMOVE(&head, np, entry, entries);
free(np);
}
/* List Deletion. */
while (!SLIST_EMPTY(&head)) {
n1 = SLIST_FIRST(&head);
SLIST_REMOVE_HEAD(&head, entries);
free(n1);
}
Montag, 1. Juli 2013
Anwendungen
• Linked List mit allen Peers
• Routes List
Montag, 1. Juli 2013
Threads
• ProVerbindung ein Thread
• ein Thread um den eingangs Port zu
überwachen
• ein Thread um Packet History zu leeren
Montag, 1. Juli 2013
65 5
54 4
54 4
Anzahl Threads
Montag, 1. Juli 2013
Peer Tasks
• Jeder Task macht fread auf seinem Socket
• Falls er genügend Daten für ein Paket erhält
lockt er sich die benötigten resourcen und
verwendet es weiter
• Kein anderer Task wird benötigt um ein
Paket weiterzusenden
Montag, 1. Juli 2013
Python vs C
• Versenden von 1000 Paketen
• 2 Nodes
Montag, 1. Juli 2013
Python C
~0.4s ~0.8s
Montag, 1. Juli 2013

Weitere ähnliche Inhalte

Empfohlen

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
 

Empfohlen (20)

Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 

Meshnode

  • 1. Mesh Network Seminararbeit von Marc Egli Montag, 1. Juli 2013
  • 2. Probleme • Rapid Prototyping? • Test Driven Development? Montag, 1. Juli 2013
  • 3. Rapid Prototyping • Ist einfach mit Python • Twisted als Networking Engine • Lauffähiger Prototyp am 17. März Montag, 1. Juli 2013
  • 4. Test Driven Development • Gegen eine bestehendeVersion Testen • util.py für Abläufe Montag, 1. Juli 2013
  • 5. Open Source Anmerkung • nur mit Lizenz Montag, 1. Juli 2013
  • 7. Design Ziele • Das Rad nicht neu erfinden • Möglichst viele sinnvolle Threads • Kein Eventloop • Socket Buffer ausnutzen Montag, 1. Juli 2013
  • 8. Linked Lists • BSD Libc hat Linked List Makros • Lassen sich für beliebige Structs verwenden Montag, 1. Juli 2013
  • 9. /* Singly-linked List head. */ SLIST_HEAD(slisthead, entry) head = SLIST_HEAD_INITIALIZER(head); struct slisthead *headp; /* Singly-linked List. */ struct entry { ... SLIST_ENTRY(entry) entries; ... } *n1, *n2, *n3, *np; SLIST_INIT(&head); /* Initialize the list. */ n1 = malloc(sizeof(struct entry)); /* Insert at the head. */ SLIST_INSERT_HEAD(&head, n1, entries); n2 = malloc(sizeof(struct entry)); /* Insert after. */ SLIST_INSERT_AFTER(n1, n2, entries); SLIST_REMOVE(&head, n2, entry, entries);/* Deletion. */ free(n2); n3 = SLIST_FIRST(&head); Montag, 1. Juli 2013
  • 10. /* Deletion from the head. */ SLIST_REMOVE_HEAD(&head, entries); free(n3); /* Forward traversal. */ SLIST_FOREACH(np, &head, entries) np-> ... /* Safe forward traversal. */ SLIST_FOREACH_SAFE(np, &head, entries, np_temp) { np->do_stuff(); ... SLIST_REMOVE(&head, np, entry, entries); free(np); } /* List Deletion. */ while (!SLIST_EMPTY(&head)) { n1 = SLIST_FIRST(&head); SLIST_REMOVE_HEAD(&head, entries); free(n1); } Montag, 1. Juli 2013
  • 11. Anwendungen • Linked List mit allen Peers • Routes List Montag, 1. Juli 2013
  • 12. Threads • ProVerbindung ein Thread • ein Thread um den eingangs Port zu überwachen • ein Thread um Packet History zu leeren Montag, 1. Juli 2013
  • 13. 65 5 54 4 54 4 Anzahl Threads Montag, 1. Juli 2013
  • 14. Peer Tasks • Jeder Task macht fread auf seinem Socket • Falls er genügend Daten für ein Paket erhält lockt er sich die benötigten resourcen und verwendet es weiter • Kein anderer Task wird benötigt um ein Paket weiterzusenden Montag, 1. Juli 2013
  • 15. Python vs C • Versenden von 1000 Paketen • 2 Nodes Montag, 1. Juli 2013