SlideShare a Scribd company logo
1 of 12
Network AddressNetwork Address
TranslationTranslation
MI 221 Internet TechnologyMI 221 Internet Technology
Mr.Shanin HoontrakulMr.Shanin Hoontrakul
((ออ..ชนินทร์ ฮุนตระกูลชนินทร์ ฮุนตระกูล))
Email:hoontrakul@hotmail.comEmail:hoontrakul@hotmail.com
Facebook:hoontrakul@hotmail.comFacebook:hoontrakul@hotmail.com
Google:shaninh@gmail.comGoogle:shaninh@gmail.com
Line:launcelot1977Line:launcelot1977
Network Address TranslationNetwork Address Translation
(NAT)(NAT)
 ดังที่กล่าวไปแล้วหากเครือข่ายที่ใช้งาน private IP
address ต้องการเชื่อมต่อเพื่อใช้งานอินเตอร์เน็ต จะ
ต้องผ่านกระบวนการการเปลี่ยนหมายเลข private IP
address เดิมให้เป็น public IP address ก่อนเสมอ
จึงจะสามารถเชื่อมต่ออินเตอร์เน็ตได้ เราเรียก
กระบวนการทำางานนี้ว่าการทำา NAT
ประเภทของประเภทของ NAT by CiscoNAT by Cisco
 วิธีการในการเปลี่ยนระหว่าง private IP address กับ
public IP address สามารถแบ่งได้เป็น 4วิธีดังนี้
 Static NATStatic NAT
 Dynamic NATDynamic NAT
 Overloading or PATOverloading or PAT
 OverlappingOverlapping
Static NATStatic NAT
 วิธีการ mapping หมายเลข private IP address เข้า
กับ public IP address แบบหนึ่งต่อหนึ่ง (one-to-
one) เพื่อให้ผู้ใช้ภายนอกสามารถเข้าถึงอุปกรณ์ที่ใช้
private IP address ซึ่งอยู่ภายในเครือข่ายแบบส่วน
ตัวได้ รวมทั้งให้ผู้ใช้ภาในเครือข่ายส่วนตัว สามารถ
เชื่อมต่อไปยังภายนอกโดยมี public IP address เป็น
ของตัวเอง ไม่ต้องแบ่งปันกับใคร
 จากรูปตัวอย่าง เมื่อเครื่องต้นทางซึ่งมี source IP address
เป็น private IP address 192.168.32.10 พยายามส่ง
ข่าวสารไปยังเครือข่ายสาธารณะผ่าน NAT router, NAT
router ก็จะทำาการเปลี่ยน source IP address ของข่าวสาร
เหล่านั้นเป็น public IP address ที่ได้จับคู่ไว้ ซึ่งในรูปคือ
public IP address 213.18.123.110
 ในทางกลับกันเมื่อโฮสต์ในเครือข่ายสาธารณะส่งข่าวสารไป
ยัง destination IP address 213.18.123.110 เมื่อข่าวสาร
ถูกส่งมาจนถึง NAT router, NAT router ก็จะเปลี่ยน
destination IP address เดิมให้เป็น private IP address
192.168.32.10 ตามที่ได้จับคู่ไว้
Dynamic NATDynamic NAT
 เมื่อ public IP address มีจำากัด ขณะที่ private IP address ของแต่ละ
องค์กรมีจำานวนมาก การทำา Static NAT จึงไม่สามารถตอบโจทย์การทำางาน
ได้ จึงมีการคิดค้นวิธีการ mapping แบบ Dynamic NAT ขึ้นมากทดแทน
 กระบวนการทำางานของ Dynamic NAT จะ
กำาหนดกลุ่มของ public IP addresses ขึ้น
มากลุ่มหนึ่ง เพื่อให้ private IP addresses
มา mapping ไปแบบหนึ่งต่อหนึ่ง เช่นเดียวกับ
แบบ static NAT แต่จะแตกต่างกันตรงที่แบบ
Dynamic NAT จะไม่มีการระบุเจาะจงว่า
private IP address นี้จะถูก mapping ไปเป็น
public IP address อะไร
 กลไกการ mapping จะดำาเนินการเปลี่ยนจาก
private IP address ไปเป็น public IP address เอง
โดยพิจารณาจาก public IP address ที่ว่างอยู่ใน
ขณะนั้น จากตัวอย่าง กำาหนด IP แบบจดทะเบียน
สำาหรับออกอินเทอร์เน็ตไว้กลุ่มหนึ่งคือ
213.18.123.100 ถึง 213.18.123.150 เมื่อโฮสต์
ภายในเครือข่ายที่ใช้งาน private IP address
192.168.32.10 จะเชื่อมต่อสู่เครือข่ายสาธารณะ
NAT router ก็จะทำาการตรวจสอบ public IP
address ที่ว่างอยู่ และเปลี่ยน source IP address
เดิมให้เป็น public IP address แทน เพื่อส่งออกไป
OverloadingOverloading
 เครื่องคอมพิวเตอร์ทุกเครื่องใน private network จะถูกเปลี่ยน
IP address เป็น IP เดียวกันเมื่อต้องการเชื่อมต่อเข้าสู่
อินเทอร์เน็ต โดยอาศัยหมายเลข ports (กล่าวถึงในภายหลัง)
ในการแยกว่าข่าวสารหรือ packet ที่ส่งออกไปสู่เครือข่าย
สาธารณะเป็นของเครื่องใด
 การทำา Overloading มีชื่อเรียกอื่นๆ เช่น
PAT (Port Address Translation), single
address NAT หรือ port-level multiplexed
NAT เป็นต้น
 จากตัวอย่าง ทุกๆเครื่องจะถูกเปลี่ยนเป็น IP
213.18.123.100 และถูกแยกว่าเป็นของ
เครื่องใดโดยใช้ port ที่แตกต่างกัน เป็นตัว
แยกแยะและบันทึกรายละเอียดการจับคู่ไว้ที่
OverlappingOverlapping
 โดยทั่วไปแล้วหมายเลข public IP address ของแต่ละ ISP จะเป็นคนละชุด
กัน หากมีความจำาเป็นต้องเปลี่ยน ISP จากรายเดิมเป็นรายใหม่ หมายเลข
public IP address ก็จะต้องเปลี่ยนตาม ซึ่งในหลายๆครั้งก่อให้เกิดปัญหา
เนื่องจากความซับซ้อนของทั้งโปรแกรมทำางาน และเครือข่าย
 การทำา Overlapping จึงถูกนำามาใช้เพื่อให้องค์กร
สามารถใช้หมายเลข public IP addresses ชุดเดิม
ได้เมื่อย้ายไปอยู่กับ ISP รายใหม่ โดยกำาหนดให้
router จะต้องเปลี่ยน IP ภายในเครือข่ายภายใน
(internal addresses) เดิม ให้เป็น public IP
address ของผู้ให้บริการรายใหม่ ซึ่งไม่ซำ้ากกับของ
ที่อื่น (registered unique addresses) ก่อนส่งออก
อินเทอร์เน็ต และเปลี่ยน IP ที่จดทะเบียนจาก
ภายนอก (external registered address) เป็น IP
ซึ่งไม่ซำ้ากับเครือข่ายภายใน (unique to the private
network) ซึ่งสามารถทำาได้โดยการใช้ static NAT

More Related Content

Featured

AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
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
 

Featured (20)

AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
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
 

[Ch05 02] nat (1)

  • 1. Network AddressNetwork Address TranslationTranslation MI 221 Internet TechnologyMI 221 Internet Technology Mr.Shanin HoontrakulMr.Shanin Hoontrakul ((ออ..ชนินทร์ ฮุนตระกูลชนินทร์ ฮุนตระกูล)) Email:hoontrakul@hotmail.comEmail:hoontrakul@hotmail.com Facebook:hoontrakul@hotmail.comFacebook:hoontrakul@hotmail.com Google:shaninh@gmail.comGoogle:shaninh@gmail.com Line:launcelot1977Line:launcelot1977
  • 2. Network Address TranslationNetwork Address Translation (NAT)(NAT)  ดังที่กล่าวไปแล้วหากเครือข่ายที่ใช้งาน private IP address ต้องการเชื่อมต่อเพื่อใช้งานอินเตอร์เน็ต จะ ต้องผ่านกระบวนการการเปลี่ยนหมายเลข private IP address เดิมให้เป็น public IP address ก่อนเสมอ จึงจะสามารถเชื่อมต่ออินเตอร์เน็ตได้ เราเรียก กระบวนการทำางานนี้ว่าการทำา NAT
  • 3. ประเภทของประเภทของ NAT by CiscoNAT by Cisco  วิธีการในการเปลี่ยนระหว่าง private IP address กับ public IP address สามารถแบ่งได้เป็น 4วิธีดังนี้  Static NATStatic NAT  Dynamic NATDynamic NAT  Overloading or PATOverloading or PAT  OverlappingOverlapping
  • 4. Static NATStatic NAT  วิธีการ mapping หมายเลข private IP address เข้า กับ public IP address แบบหนึ่งต่อหนึ่ง (one-to- one) เพื่อให้ผู้ใช้ภายนอกสามารถเข้าถึงอุปกรณ์ที่ใช้ private IP address ซึ่งอยู่ภายในเครือข่ายแบบส่วน ตัวได้ รวมทั้งให้ผู้ใช้ภาในเครือข่ายส่วนตัว สามารถ เชื่อมต่อไปยังภายนอกโดยมี public IP address เป็น ของตัวเอง ไม่ต้องแบ่งปันกับใคร
  • 5.  จากรูปตัวอย่าง เมื่อเครื่องต้นทางซึ่งมี source IP address เป็น private IP address 192.168.32.10 พยายามส่ง ข่าวสารไปยังเครือข่ายสาธารณะผ่าน NAT router, NAT router ก็จะทำาการเปลี่ยน source IP address ของข่าวสาร เหล่านั้นเป็น public IP address ที่ได้จับคู่ไว้ ซึ่งในรูปคือ public IP address 213.18.123.110  ในทางกลับกันเมื่อโฮสต์ในเครือข่ายสาธารณะส่งข่าวสารไป ยัง destination IP address 213.18.123.110 เมื่อข่าวสาร ถูกส่งมาจนถึง NAT router, NAT router ก็จะเปลี่ยน destination IP address เดิมให้เป็น private IP address 192.168.32.10 ตามที่ได้จับคู่ไว้
  • 6. Dynamic NATDynamic NAT  เมื่อ public IP address มีจำากัด ขณะที่ private IP address ของแต่ละ องค์กรมีจำานวนมาก การทำา Static NAT จึงไม่สามารถตอบโจทย์การทำางาน ได้ จึงมีการคิดค้นวิธีการ mapping แบบ Dynamic NAT ขึ้นมากทดแทน
  • 7.  กระบวนการทำางานของ Dynamic NAT จะ กำาหนดกลุ่มของ public IP addresses ขึ้น มากลุ่มหนึ่ง เพื่อให้ private IP addresses มา mapping ไปแบบหนึ่งต่อหนึ่ง เช่นเดียวกับ แบบ static NAT แต่จะแตกต่างกันตรงที่แบบ Dynamic NAT จะไม่มีการระบุเจาะจงว่า private IP address นี้จะถูก mapping ไปเป็น public IP address อะไร
  • 8.  กลไกการ mapping จะดำาเนินการเปลี่ยนจาก private IP address ไปเป็น public IP address เอง โดยพิจารณาจาก public IP address ที่ว่างอยู่ใน ขณะนั้น จากตัวอย่าง กำาหนด IP แบบจดทะเบียน สำาหรับออกอินเทอร์เน็ตไว้กลุ่มหนึ่งคือ 213.18.123.100 ถึง 213.18.123.150 เมื่อโฮสต์ ภายในเครือข่ายที่ใช้งาน private IP address 192.168.32.10 จะเชื่อมต่อสู่เครือข่ายสาธารณะ NAT router ก็จะทำาการตรวจสอบ public IP address ที่ว่างอยู่ และเปลี่ยน source IP address เดิมให้เป็น public IP address แทน เพื่อส่งออกไป
  • 9. OverloadingOverloading  เครื่องคอมพิวเตอร์ทุกเครื่องใน private network จะถูกเปลี่ยน IP address เป็น IP เดียวกันเมื่อต้องการเชื่อมต่อเข้าสู่ อินเทอร์เน็ต โดยอาศัยหมายเลข ports (กล่าวถึงในภายหลัง) ในการแยกว่าข่าวสารหรือ packet ที่ส่งออกไปสู่เครือข่าย สาธารณะเป็นของเครื่องใด
  • 10.  การทำา Overloading มีชื่อเรียกอื่นๆ เช่น PAT (Port Address Translation), single address NAT หรือ port-level multiplexed NAT เป็นต้น  จากตัวอย่าง ทุกๆเครื่องจะถูกเปลี่ยนเป็น IP 213.18.123.100 และถูกแยกว่าเป็นของ เครื่องใดโดยใช้ port ที่แตกต่างกัน เป็นตัว แยกแยะและบันทึกรายละเอียดการจับคู่ไว้ที่
  • 11. OverlappingOverlapping  โดยทั่วไปแล้วหมายเลข public IP address ของแต่ละ ISP จะเป็นคนละชุด กัน หากมีความจำาเป็นต้องเปลี่ยน ISP จากรายเดิมเป็นรายใหม่ หมายเลข public IP address ก็จะต้องเปลี่ยนตาม ซึ่งในหลายๆครั้งก่อให้เกิดปัญหา เนื่องจากความซับซ้อนของทั้งโปรแกรมทำางาน และเครือข่าย
  • 12.  การทำา Overlapping จึงถูกนำามาใช้เพื่อให้องค์กร สามารถใช้หมายเลข public IP addresses ชุดเดิม ได้เมื่อย้ายไปอยู่กับ ISP รายใหม่ โดยกำาหนดให้ router จะต้องเปลี่ยน IP ภายในเครือข่ายภายใน (internal addresses) เดิม ให้เป็น public IP address ของผู้ให้บริการรายใหม่ ซึ่งไม่ซำ้ากกับของ ที่อื่น (registered unique addresses) ก่อนส่งออก อินเทอร์เน็ต และเปลี่ยน IP ที่จดทะเบียนจาก ภายนอก (external registered address) เป็น IP ซึ่งไม่ซำ้ากับเครือข่ายภายใน (unique to the private network) ซึ่งสามารถทำาได้โดยการใช้ static NAT