Network Address Translation - NAT Explained

Поділитися
Вставка
  • Опубліковано 7 лют 2025
  • NAT network address translation is a process of mapping an IP address or IP port pair to another IP address or IP: port. You might be wondering what a software engineer like me doing making a video on a low level networking concept? I have good reasons for that. NAT was originally designed to solve the ipv4 limited IP addresses, but since been used for port forwarding and layer 4 load balancing through the virtual ip address such as Haproxy thats why I decided to make a video about NAT from a software engineer view. In this video we will explain how NAT works and we will explain its applications.
    Download slides here payhip.com/b/u...
    (Members get slides to all my content for free)
    Stay Awesome!
    Hussein

КОМЕНТАРІ • 160

  • @jaafarbalaghi9012
    @jaafarbalaghi9012 Рік тому +5

    Thank you. I have a kind of disease that I have to be curious about any topic in programming. And now I found my cure: Hussein Nasser! Your videos have exactly this property of going deep into the subject

  • @pajotrus
    @pajotrus 4 роки тому +209

    this is better than netflix

    • @suadrifrasan2726
      @suadrifrasan2726 4 роки тому +8

      In fact it is better. Got bored of Netflix... and now watching this at 1:30am

    • @jaykothari8798
      @jaykothari8798 4 роки тому +2

      Need to cancel my subscription 😛

    • @giovanni-cx5fb
      @giovanni-cx5fb 4 роки тому +21

      It's NATflix.

    • @elhakimdev
      @elhakimdev 4 роки тому +1

      @@giovanni-cx5fb Good one XD

    • @giovanni-cx5fb
      @giovanni-cx5fb 4 роки тому

      @@elhakimdev
      Thanks 😆

  • @bleronqorri3011
    @bleronqorri3011 Рік тому

    Just wanna say one thing Hussein, I really really appreciate the in-depth explanations. I've seen many videos on protocols that just barely scratch the surface and you're left with more questions than answers at the end. You instead go and explain every little detail, with an approach that makes sense.
    Thank you. I'm becoming a better Software Engineer daily by watching the stuff you post and talk about.

  • @elultimopujilense
    @elultimopujilense 4 роки тому +58

    I blame the youtube algorithm. I should have found this channel a long time ago.

  • @ankansharma4897
    @ankansharma4897 2 роки тому +4

    Your explanation style and in-depth explanation are pure gold. We don't need an explanation in 2 min videos. Your explanation helped me connect the loophole in concepts and make it crystal clear perfectly. Thank you. Very much appreciate your efforts.

  • @ramyfarid2296
    @ramyfarid2296 4 роки тому +19

    This channel is pure gold!!

  • @zsigmondforianszabo4698
    @zsigmondforianszabo4698 4 місяці тому +1

    bro has a good time recording amazing explaining videos while being high

  • @keithjacob4636
    @keithjacob4636 5 років тому +15

    Great video! I love the way you explain things and I really enjoy your attitude . You make this fun! I watched a few other videos you have and I am a fan. Keep up the great work! Thanks

    • @hnasr
      @hnasr  5 років тому +5

      Thank you Keith, really appreciate your comment and compliment. I try to lighten up the mood on dry topics like this. I know it could also be distracting sometimes when I do it too much So Im trying to find the balance.
      Thanks again! Cheers

    • @sharvarigc7714
      @sharvarigc7714 4 роки тому

      Me too!

  • @amoldeshpande5369
    @amoldeshpande5369 4 роки тому +15

    Hi Sir, I am new member and have recently subscribed to your channel. Your style of explaining is really very good, all your videos are very informative. Please do not think that you speak a lot, actually you are doing a great job by explaining the concepts in detail. Thanks for all your efforts.

    • @hnasr
      @hnasr  4 роки тому

      Thank you Amol! So kind of you 🙏

  • @mrunalumate5399
    @mrunalumate5399 Рік тому

    this is how teaching should be....Just wow...!! how we get familier with networking so easily...

  • @muhammadahsan9275
    @muhammadahsan9275 2 роки тому +4

    I hated networking, i withdrawn my computer network course in university. i hated the teacher as well who teach us networking. after listening and watching your videos on webRTC and NAT, now i am thinking networking is not that much bad👀.
    BTW Thank you for such a great backend engineering content.

  • @mprasanth18
    @mprasanth18 Рік тому

    Thanks a lot for making this video. It cleared my gap in NAT.

  • @ramjonchhen5882
    @ramjonchhen5882 2 роки тому

    Really This is one of the best videos, I have seen on NAT. Thank you for explaining the concept in such simple way.

  • @sukiyang3474
    @sukiyang3474 3 роки тому

    I like how you talk about related knowledge. It's like connecting the dots. Learn so much from your videos. Thank you so much ~

  • @hariomkuntal9520
    @hariomkuntal9520 2 роки тому +1

    Awesome explanation Hussein. I love your videos, they are so at the basics and clear the fundamentals

    • @hnasr
      @hnasr  2 роки тому

      Thank you! Glad you liked it

  • @bobslave7063
    @bobslave7063 Рік тому

    Amazing job Hussein. Thanks for the best explanation!

  • @georgeli6820
    @georgeli6820 3 роки тому

    Best explanation ever on UA-cam

  • @g0thman865
    @g0thman865 4 роки тому +1

    On top of the great content.
    I just want to say that your thumbnails are awesome!!

  • @sagarchopade6656
    @sagarchopade6656 5 років тому +12

    Sir it's fun to learn. Thanks you, such a great video.

    • @hnasr
      @hnasr  5 років тому +2

      It is fun indeed! Thanks for your comment 🙏

  • @MrRoBot-wn4kp
    @MrRoBot-wn4kp 2 роки тому

    Thank you..one of the best channels

  • @ZeeshanAli-nk3xk
    @ZeeshanAli-nk3xk 2 роки тому

    in love with your videos! Allahumma baarik ya akhi!

  • @wick12298
    @wick12298 2 роки тому

    You talk alot, and that's the best thing XD. Explaining in so much detail, its like you are learning with us and discovering as we go.

  • @usamatahseenulhaque9125
    @usamatahseenulhaque9125 4 роки тому +2

    Even though videos are long but its worth watching thanks keep it up

    • @hnasr
      @hnasr  4 роки тому +1

      Usama Wizard thank you Usama

  • @fazalali2771
    @fazalali2771 4 роки тому +1

    Man! You're awesome.
    "Router says, you wanna go out but you're naked, let me put some clothes on you 😂"

  • @patrickjason4384
    @patrickjason4384 3 роки тому

    WOW fun and learning at the same time great stuff dude keep it up

  • @Douglas_Gillette
    @Douglas_Gillette 2 роки тому +1

    Routers do not have an IP address. The interfaces on the router have IP addresses. This is particular but very important.

  • @krishnakrmahto97
    @krishnakrmahto97 3 роки тому +1

    I read (really sorry if you also mentioned it in the video and I missed it) that NAT functions at the network layer (layer 3). Port forwarding deals with ports which is a layer 4 concept. Want to know if this fact is ignored when implementing NAT? What's bothering me more is that router is also a layer 3 thing, ideally I would think it doesn't have enough tech physically built into it to work on anything beyond layer 3.
    Sorry if this doesn't make sense, thanks!

  • @nguyenlouis4690
    @nguyenlouis4690 4 роки тому +1

    It's so helpful. Thanks so much for your content

    • @hnasr
      @hnasr  4 роки тому

      Thank you Kelbin!! 🙏 glad you like the content

  • @shashikantpawar7069
    @shashikantpawar7069 3 роки тому +1

    Thank you for the content 🙏🙏

  • @heetdave6779
    @heetdave6779 2 роки тому

    Legendary Video

  • @devyetii
    @devyetii 4 роки тому +4

    Redirected her from your latest video about NAT Slipstreaming and I'd like to really thank you about the great effort you put in your content ❤️.
    I just have one question, What if client A with prvt. IP 192.168.0.17 and client B with prvt. IP 192.168.0.18, both wants to access let's say a nodejs server on server with pub. IP 40.82.84.10:8080 (imaginary 😅), both of them happen to create the same random port on let's say 8992 but each of them sent different messages. How will NAT know which response to send to which MAC address. Does it store the MAC address of the sender as well ?

    • @hnasr
      @hnasr  4 роки тому +6

      Fantastic question!!! The router in this case will detect that and rewrite a new port for the second host and when it comes back it will rewrite it to the original.

    • @devyetii
      @devyetii 4 роки тому

      @@hnasr Oh got it ! Great thanks for your reply جزاك الله خيرا

    • @Iamkumargaurav
      @Iamkumargaurav Рік тому

      ​@@hnasr ​ hi there, so the number of translations, for the same nodejs server is limited by number of ports available.(2^16).
      what if i want to get through more connections than 2^16

    • @Iamkumargaurav
      @Iamkumargaurav Рік тому

      do we have something like port multiplexing here :D

  • @timmy5362
    @timmy5362 3 роки тому +4

    Hi! Thank you so much for these videos! Very entertaining and informative! One question, what if two devices (within the same network) made a request to the same server, how would the router know whom to send the response to?

    • @hnasr
      @hnasr  3 роки тому +3

      Sure thing! Each client will get a unique source port which the router will use to send back data

    • @timmy5362
      @timmy5362 3 роки тому

      @@hnasr Thanks for clearing!

    • @booleanboolean2984
      @booleanboolean2984 3 роки тому +3

      @@hnasr won't they have different local ip address apart from port ??

    • @iplaty9830
      @iplaty9830 2 роки тому +1

      @@booleanboolean2984 yes

  • @zakizaz1
    @zakizaz1 4 роки тому

    Great content sir, and also so much fun to follow .. Thank you .

  • @thatguyadarsh
    @thatguyadarsh 4 роки тому

    Man !!! 13:28 You are hilarious. Great Video. Respect !!

  • @manjunathreddy5966
    @manjunathreddy5966 Рік тому

    Superb 🎉

  • @rahulsyt_
    @rahulsyt_ 9 днів тому

    This is your first video that I am finding a bit hard to understand

  • @dumbskull5593
    @dumbskull5593 3 роки тому +2

    Great video! I think I understood the main concept. But I do have a doubt. What if there are multiple devices within a local network that's working on the same port (all devices working on port 8080 for example). How will the router make the NAT table in that case?

    • @radonspace2098
      @radonspace2098 2 роки тому

      My answer to that is each device even though on the same local network has a unique Ip address. John Chandler, Damon Chandler, Maddy Chandler. all Chandler's but with unique names.

  • @elmeroranchero
    @elmeroranchero 3 роки тому +2

    This is lovely XD

  • @criticalnewstvcriticalanal2495

    For consistency it should be said, that from the WAN-Port (44.11.5.17) to the host 44.12.1.9, it must be routed again.

  • @asishreddy7729
    @asishreddy7729 4 роки тому +1

    You wouldn't believe how long I had to search for to get this answer.I didn't even know it was called NAT, I was just typing stuff like "how router knows my computer when it receives data". Anyway, one question, what if the client machine pings the same server from two different ports? How does the router handle that ? cuz it just saves client IP and port with the server IP and port so how does it distinguish between the two client ports?

    • @hnasr
      @hnasr  4 роки тому +1

      Glad you found the content!
      So lets unpack your example
      client (ip address c) and server (ip address s)
      Client want to connect to s:80
      client creates a random port 1234
      Router sees client want to go s:80 and creates a mapping on its public ip (lets call it r) with another port,, created a NAT entry as follows
      c:1234 wants going to s:80 through r:9876
      Now client want to connect to s:25
      Client creates another random port c:1235 and router creates new entry as follows
      C:1235 going to s:25 through r:9875
      So it is always a unique mapping.

    • @asishreddy7729
      @asishreddy7729 4 роки тому +1

      Ohhh so router creates a new port for every entry ? Because my question was c:1234 wants to go to s:80 and then c:5678 also wants s:80. so when s:80 responds the router needs to find the correct client and that was my doubt.

  • @singaravelann3671
    @singaravelann3671 4 роки тому +1

    Thanks again for the such a good content, Here when we want to communicate to other server which is another network and which TLS request, who will take care of TCP handshake and who will validate that certificate given by server.

  • @tahasaleh4697
    @tahasaleh4697 4 роки тому +1

    If 2 clients from the same subnet made the same request to the same server over the internet, when the server replies and the router receives the packet, will oit find that there are two entries in the NAT table that map to the same request? How does the router know to which client this response belongs to? Is NAT aware of the session ID?

  • @aqeelzeid24
    @aqeelzeid24 3 роки тому

    Amazing content !!!!!!

  • @aryankumar87771
    @aryankumar87771 2 роки тому

    so what you're saying is to communicate on the internet we don't need to send MAC addresses along with the data frame ? MAC is only needed on a local network right. Am i right Hussein ?

  • @palaniappanrm6277
    @palaniappanrm6277 4 роки тому +1

    Does Load Balancer uses NAT only to keep track of where it should forward the response back by who made the request?

  • @SuperMichielv
    @SuperMichielv 4 роки тому +2

    I have a question about IP addresses in same local network.
    If I run a local server on my PC localhost:9090 with IP 192.168.0.111
    Wy can't I connect to it from my smartphone in the same network by giving the address 192.168.0.111:9090

    • @hnasr
      @hnasr  4 роки тому +2

      Assuming your phone is connected to the same WIFI network than you should unless the your computer does not allow inbound traffic? If it is windows enable port 9090 inbound windows firewall

    • @SuperMichielv
      @SuperMichielv 4 роки тому +1

      @@hnasr
      Ok, thanks It was firewall related.
      I'm using Linux Mint on my PC.
      I googled and did the following:
      sudo ufw allow from any to any port 9090 proto tcp
      sudo ufw status
      Status: active
      To Action From
      -- ------ ----
      9090/tcp ALLOW Anywhere
      9090/tcp (v6) ALLOW Anywhere (v6)
      Now it worked!
      Thanks to give me advice!

  • @yaseengousesamudri9390
    @yaseengousesamudri9390 2 роки тому

    But what if 2 machines on the same subnet send different requests to the same destination? How does the router know, where in its subnet, to send the received response back to?
    i) Does it store extra information about those requests?
    ii) Does it overwrite the the original sender's information in the stored info.?
    iii) Does it send all the received responses from the destination to both the senders? (Doens't feel correct)

  • @rohantammewar6337
    @rohantammewar6337 3 роки тому

    Just one question. When the router assigns a public ip address to a request is it unique? If yes, how does he checks if the IP address is unique and what if there are no IP address available for that instance?

  • @lakshay7906
    @lakshay7906 5 місяців тому

    i don't know i may be wrong in when you make a get request shouldn't it go from layer 7 to layer 1
    4:19
    it should be
    source ip address | source port number |get| destination port number | destination ip address

  • @albinpaul3429
    @albinpaul3429 3 роки тому

    I love the part where you said we can address aliens with ipv6.

  • @singaravelann3671
    @singaravelann3671 4 роки тому +1

    Here in NAT, What if multiple request are been sent to same networks by different machines, how the response will be get back to the right machine using NAT table.

    • @hnasr
      @hnasr  4 роки тому +2

      Good question!
      each machine in the internal network will have a unique IP address internally but the same public IP address (the router)
      The NAT table will have the internal port/IP address mapped to the public IP address with a random internal port..

  • @9lofivibes
    @9lofivibes 4 роки тому

    It makes lot of sense cool

  • @kayeshparvez
    @kayeshparvez 3 роки тому

    Say two clients in the same subnet send request to the same server app. The nat table is updated with two entries. Then the request reaches the target server. The server then replies back to receiver. In this case, the router should be confused to find out real receiver. and how the port forwarding will work now ?

  • @samueladewale2987
    @samueladewale2987 4 роки тому +1

    What happens when multiple client nodes from the same subnet are reaching out to the external target node system?

    • @hnasr
      @hnasr  4 роки тому

      They each get a unique source port to identify them

  • @balsubu1
    @balsubu1 2 роки тому

    awesome...

  • @vadimgoldenko6843
    @vadimgoldenko6843 4 роки тому

    Interesting thing, this NAT. One question about it: how the source machine picks random port? Believe, source machine should ensure the port is free. But how the machine knows the port is free on the router? I guess, it sends a simple request to get that port is free to router. But what if all router ports are busy? So the request should not be sent, right?

    • @hnasr
      @hnasr  4 роки тому

      The machine keeps track of all its used source ports because it has a list of all active connections. Usually the operating system takes care of this ..
      Good question

  • @КристиянКалугеров

    You are crazy but I do like your videos and way of expression :))

  • @mohammadturabali3870
    @mohammadturabali3870 4 роки тому

    Mr Hussein , when you say that the source attaches the MAC address of the router to the packet, then does it mean that in the data link layer when it attaches the mac address of destination it attaches the mac address of router instead of final destination , if so then how does the packet reach the destination mac address if the destination mac address is not attached to the packet when it is launched from the router.

  • @exe.m1dn1ght
    @exe.m1dn1ght 2 місяці тому

    hey, what happens when the router stores in the memory 2 different private ips with the same ephemeral port and they both try to access the same server ip ?

    • @younes_khx
      @younes_khx Місяць тому

      in the NAT u give them diff ports for example one u give him : 8892 the other 8893

  • @chswin
    @chswin 2 роки тому

    You can also forward other ip protocols like GRE…

  • @singhgoldi
    @singhgoldi 2 роки тому

    Hey Hussein - Great video. Can you please share the slides?

    • @hnasr
      @hnasr  2 роки тому +1

      Thanks Gurpreet! Let me do that I forgot to do so

    • @hnasr
      @hnasr  2 роки тому

      Just posted it to the members community post :)

  • @saifsmailbox98
    @saifsmailbox98 3 роки тому

    Is the third column in your NAT table required? Can the router not forward all inbound traffic coming on 44.11.5.17:8992 to 192.168.1.2:8992 ?

  • @mateuszciupa8141
    @mateuszciupa8141 5 років тому +1

    I enjoyed it more than 2min video xd

    • @hnasr
      @hnasr  5 років тому +1

      Mateusz Ciupa 😂😂 glad you did! Thanks for watching

    • @vallwesture
      @vallwesture 4 роки тому

      I also enjoyed more than 2 min videos! It brings more explanation and connects everything together!

  • @unnoticedspacegoat8537
    @unnoticedspacegoat8537 2 роки тому

    what happens when multiple clients sends a request to the same ip address. How does the router know which request should be forwarded back to which client?

    • @hnasr
      @hnasr  2 роки тому

      a random source port will be assigned to both clients. those ports will be used to reroute packets back to each client.
      e.g.
      bot h 10.0.0.1 and 10.0.0.2 want to visit 8.8.8.8 : 80 , public router ip 1.2.3.4
      router will have two entries
      10.0.0.1 : 1111 -> 1.2.3.4: 1111 -> 8.8.8.8 : 80
      10.0.0.2 : 2222 -> 1.2.3.4: 2222 -> 8.8.8.8: 80

  • @nathanbenton2051
    @nathanbenton2051 4 роки тому +2

    wow another great video - thank you! question: so where does the modem fit into this picture?

    • @sudqi
      @sudqi 4 роки тому +1

      Modem comes before the router. It is probably a layer 2 device and basically what it does is to convert from telephone signals to ethernet signals and vice versa

  • @takudzwamhonde1276
    @takudzwamhonde1276 2 роки тому

    Hi, Hussein. Quick question. In your OSI video, you have the port numbers before the IP address in the packet structure and in this video, you have the reverse of that. I assumed that the port numbers get added before the IP addresses. Is this a mistake or I am wrong?

    • @hnasr
      @hnasr  2 роки тому

      The way I present it is just for visualization and explanation purposes.
      In reality, the IP packet header has the ip addresses and the TCP segment has the port.

  • @logesh-s2245
    @logesh-s2245 3 роки тому

    How does packet flow between different subnets?

  • @virendrabhati6685
    @virendrabhati6685 3 роки тому

    Could you please explain NAT type too . Thanks again 👍

  • @nithishkarthik9163
    @nithishkarthik9163 4 роки тому

    What if there are two local machines sending packets to the same server, in that case, what would the router do because, when the response comes back from the server, now the router will be confused as to where to send it know??

    • @hnasr
      @hnasr  4 роки тому +1

      Router will assign a unique source port for each machine so when the server reply to the router ip and port, the router will forward the packets back to the correct machine

    • @nithishkarthik9163
      @nithishkarthik9163 4 роки тому

      @@hnasr now it makes sense..👍

  • @andreigatej6704
    @andreigatej6704 4 роки тому +1

    Great video!
    Isn't something similar happening when using docker? For example, if we want to containerize a nodejs app, we might instantiate the container with `-p 49160:8080`, so when going to the port of the host (49160), it will map to the private address of the container, which uses 8080. Is this correct?

    • @hnasr
      @hnasr  4 роки тому +2

      Andrei Gătej that is very similar to iptables where it maps ports to internal virtual networks created by docker

  • @alexstoyanov6792
    @alexstoyanov6792 5 років тому

    Great content!

    • @hnasr
      @hnasr  5 років тому

      Alex Stoyanov thank you Alex!

  • @abba5.rangwala
    @abba5.rangwala 4 роки тому +2

    If there are two device 192.168.1.2 and 192.168.1.3 and both request from the same port 8992 for the same address 44.12.1.9:8080 then in table there will be two row. But problem is when it received the package router don't know from which device that request came because there is data duplication, So will it sent package to both server or may be router will do second request on other port.
    case 1: same port
    -----------------------------------------------------------------------------------------------------
    192.168.1.2:8892 | 44.11.5.17:8892 | 44.12.1.9.8080
    -----------------------------------------------------------------------------------------------------
    192.168.1.3:8892 | 44.11.5.17:8892 | 44.12.1.9.8080
    -----------------------------------------------------------------------------------------------------
    case 2: different port of router
    -----------------------------------------------------------------------------------------------------
    192.168.1.2:8892 | 44.11.5.17:8892 | 44.12.1.9.8080
    -----------------------------------------------------------------------------------------------------
    192.168.1.3:8892 | 44.11.5.17:8893 | 44.12.1.9.8080
    -----------------------------------------------------------------------------------------------------
    I think they implement second approach.

  • @engineerscodes
    @engineerscodes 3 роки тому

    cool video

  • @palaniappanrm6277
    @palaniappanrm6277 4 роки тому

    Even in L7 LB, the proxy has to remember the client in some way so that it can sends the response from the server back to the appropriate requested client. It can use this NAT for this or it can use some sort of mapping between TCP connections in proxy FE and proxy BE. Right?

  • @parasarora5869
    @parasarora5869 4 роки тому

    so...nat is keeps track of those changes IP addresses in a table and change it accordingly on requests ?! 🤔🤔

    • @hnasr
      @hnasr  4 роки тому +1

      Paras Arora correct, not requests though, packets

    • @parasarora5869
      @parasarora5869 4 роки тому +1

      @@hnasr ohh yes yes ... thank u for clearing !! and great video sir 👌👌

  • @abdelrhmanahmed1378
    @abdelrhmanahmed1378 4 роки тому

    i spend full day one the channel to get there, lol

    • @abdelrhmanahmed1378
      @abdelrhmanahmed1378 4 роки тому

      one question here so who can use port 80 directly without port forwarding ?! only known web servers like Apache or gws ?!also the documentation said the gateway change the port to fit more connection to one private ip range ,using what called pat(port address translation ) in the transport layer (tcp) that called port overloading ,,
      here is some resource
      ua-cam.com/video/01ajHxPLxAw/v-deo.html
      ua-cam.com/video/n0UqAXu_GAI/v-deo.html
      www.freeccnastudyguide.com/study-guides/ccna/ch10/10-4-nat-overloading-aka-port-address-translation-pat/#:~:text=NAT%20Overloading%20or%20Port%20Address,access%20to%20all%20inside%20hosts.

  • @richard-social8125
    @richard-social8125 4 роки тому

    I'll make sure to let the aliens know..they told me they're still using ipv4😂

  • @rabbyhossain6150
    @rabbyhossain6150 3 роки тому

    What happens if a machine is not connected to a router for example maybe a phone?

  • @cunningham.s_law
    @cunningham.s_law 4 роки тому

    how does the router know which machine to send the response back if two machines send a request to the same server?

    • @hnasr
      @hnasr  4 роки тому +3

      honeyspoon short answer source ports..
      Long answer
      when machine A sends a request to Server S it will have source ip and source port those are used in the NAT table to map the response back.
      E.g.
      Router store this in NAT
      A:123 connects to S on port 80
      B:456 connects to S on port 80
      If A sends a request S the router exchanges A IP with its own R, and source port 123 becomes another random port lets say 999, then when a response
      R:999 - S:80
      When server responds back to R:999
      Router says which machine is on port 999 and was destined to S:80 .. that is machine A:123

    • @cunningham.s_law
      @cunningham.s_law 4 роки тому

      @@hnasr Thanks, very clear

  • @mhmdshaaban
    @mhmdshaaban 4 роки тому

    It's kinda a ridiculous question but I have to ask it :)
    As far as my concern, the router is responsible for connecting different networks together and switch for local networks.
    So, I think in this example it should be a switch, not a router doesn't it?

    • @hnasr
      @hnasr  4 роки тому +1

      Mohamed Shaban a switch plays with Mac addresses at layer 2 while the router plays with ip addresses at layer 3 changes subnets
      But yes my router plays both as a router and a switch

    • @mhmdshaaban
      @mhmdshaaban 4 роки тому

      @@hnasr I know that bro. What I meant is that if it's a router why we are dealing with mac addresses in this stage

    • @hnasr
      @hnasr  4 роки тому +1

      I edited my comment, my router acts both as a switch and router in some cases..

    • @mhmdshaaban
      @mhmdshaaban 4 роки тому

      @@hnasr Thank you so much,
      Hussein :)

  • @osmaninci672
    @osmaninci672 3 роки тому

    14:22 two-three minutes videos are when u study exams at university🤣🤣. but if u work on a project U want a video to be longer as it can be and all words have a value of gold. maybe I should say Bitcoin.

  • @zaarare
    @zaarare 3 роки тому

    i think i have eye problem
    i'm sure this channel should have 1m subs not 100k so guess it's my problem

  • @vim55k
    @vim55k 4 роки тому

    In what video you talk about subnet?

    • @hnasr
      @hnasr  4 роки тому

      I don’t believe I discussed that hmm i do mention it here ua-cam.com/video/ECukPUUK_74/v-deo.html
      And here
      ua-cam.com/video/dh406O2v_1c/v-deo.html

  • @henrikrinne3639
    @henrikrinne3639 3 роки тому

    what if two computers want to access the same public server?

    • @henrikrinne3639
      @henrikrinne3639 3 роки тому

      ah the assigned port of the router will determine which packet go back to which pc

    • @hnasr
      @hnasr  3 роки тому +1

      Correct the router will assign a different source port for each in the NAT table

    • @henrikrinne3639
      @henrikrinne3639 3 роки тому

      @@hnasr am watching your webRTC video. 👍👍👍👍👍👍

  • @vipsvips3213
    @vipsvips3213 4 місяці тому

    ❤❤❤❤❤❤❤❤❤❤❤❤❤❤

  • @HexapoDD
    @HexapoDD 4 роки тому +1

    NOOOOOO! In the picture at ~3min I was telling myself "pls dont say router, pls dont say router" and then you said it :-( routers rout between networks. you meant a switch. sorry to be that guy...

    • @hnasr
      @hnasr  4 роки тому

      CORRECT! The switch component in my router is what did the work at 3:00~ good catch ..
      my router acts as a router and switch at the same time, routes traffic to outside network, and switches packets to the same network

    • @nournote
      @nournote 4 роки тому

      @@hnasr Also at traslation time, the source port is not necessary the same after translation, because at some point, 2 hosts may have chosen the same source port.

    • @nournote
      @nournote 4 роки тому

      @@hnasr Also, at 07:00, no need to do an ARP request, because the server has just received a packet with IP 1.2 inside a frame with MAC AAA.

  • @benripka6977
    @benripka6977 3 роки тому

    Lol sounds like a grinder account had me laughin

  • @poke_champ
    @poke_champ 5 років тому +1

    can syou show this being done? something practical

    • @hnasr
      @hnasr  5 років тому +1

      Sure! Might consider it in another video, thanks for the tip!

    • @hnasr
      @hnasr  5 років тому +2

      I just posted a new video on how to do this check it out! ua-cam.com/video/uuWzk8U4dJE/v-deo.html

  • @vim55k
    @vim55k 4 роки тому

    I think you pronounce get as git... (

  • @SaumyaSHota
    @SaumyaSHota 3 роки тому

    the talk is more like listening to some cartoon channel.

  • @batista98854
    @batista98854 3 роки тому +1

    Too much repetition. Actual topic starts at @12:00

  • @gauravsah7780
    @gauravsah7780 4 роки тому +1

    Too much crap in between for NAT basics.